781 Commits

Author SHA1 Message Date
Vinit Deshapnde
2c385ecb1c Set country code on P2p interfaces as well
This change will set country code on P2p interfaces as well, so the
drivers are free to use channels that are permitted regionally. This
is required for FCC style compliance and Miracast certification.

Bug: 10513263

Change-Id: I88c645bd488066d5167e23e2772f2e0e1f40fa8a
2013-09-09 16:28:31 -07:00
Vinit Deshapnde
10652a95b1 Fix invalid Wifi Network system crash
There is some validation code that is eventually detecting that we
have an invalid network; only the result is a crash. The right thing
to do is to do validation up front; and fail calls if the network
configuration looks invalid.

Bug: 10571289

Change-Id: I100506b777a34b26ac9a310ba508140560f87a90
2013-09-09 16:24:36 -07:00
Dmitry Shmidt
8e7c1b1222 wifi: Fix cleaning scan result cache
Bug: 10198923

Change-Id: I18dfc10860b8fb623751c62a4bc54b628246cf0c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-09-06 14:25:14 -07:00
Vinit Deshapnde
771c11b739 Merge "Fix duplicate SSID entries in the WifiSettings UI" into klp-dev 2013-09-06 17:26:39 +00:00
Lorenzo Colitti
eadf1959fb Merge "Track IP addresses in WifiStateMachine." into klp-dev 2013-09-06 03:30:15 +00:00
Lorenzo Colitti
34b2b9b6db Track IP addresses in WifiStateMachine.
This makes WifiStateMachine listen for interface address
changes. When an address changes, WifiStateMachine will update
its LinkProperties to match reality and notify the system that
the link configuration has changed. This allows wifi to keep
track of IPv6 addresses as well (previously it only knew about
the IPv4 address passed in by DHCP).

IP addresses are obtained directly from the kernel and always
match those configured on the interface, so we treat them as
authoritative and ignore addresses passed in via DHCP (by the
time DHCP passes them in we've already been notified by the
kernel anyway).

Since we now have multiple sources of link information (the
kernel for addresses and DHCP for routes and DNS, plus various
bits of static information), also move all the code that sets
mLinkProperties into one place. This allows us to be clearer
about who is authoritative for which parts of mLinkProperties.

Bug: 10232006
Change-Id: I4f262342379ce7fed172b67a1d403e3cd34f4232
2013-09-06 08:21:23 +09:00
Vinit Deshapnde
1ed7a0200a Fix duplicate SSID entries in the WifiSettings UI
The root cause is likely our 'no networks' problem; it caused people
to add new (and duplicate) entries to their list of networks; which
are haunting us now.

This change looks up the dupes, and discards them, even if they came
wifi supplicant.

Bug: 10633813
Change-Id: I656b6bf7240de6763bf84b5b406c50444af6dd48
2013-09-05 14:19:38 -07:00
Vinit Deshapnde
b402fb2fdd Merge "Rename LinkInfo to LinkQualityInfo" into klp-dev 2013-09-05 17:50:19 +00:00
Vinit Deshapnde
6a2d32597a Rename LinkInfo to LinkQualityInfo
This change renames the LinkInfo objects to LinkQuailtyInfo. The API is
still hidden; but it can be accessed via reflection.

Bug: 10342372

Change-Id: Ieccea87c467ceae5d7f76298b137573f67396cd6
2013-09-04 14:11:24 -07:00
Vinit Deshapnde
fab5c2b28e Synchronize access to single supplicant path
Both wlan0 and p2p0 state machines are accessing the supplicant socket
simultaneously; and may get responses of each other's command. This
change introduces synchronization between these two processes.

Bug: 10375978
Change-Id: I0ac0b2771311b642affc353958cc9ba2e5dd5716
2013-08-30 12:31:25 -07:00
Vinit Deshapnde
48c4747106 More elaborate logs to debug missing APs
Bug: 10375978

Change-Id: Ic9bb8f3a7a0684143e4e77f8da0d2c833293c94a
2013-08-28 13:13:40 -07:00
Sreeram Ramachandran
268f329521 Fix channel set option in wifi batch scan command.
Fix by not including extraneous delimiters, and changing the delimiter from a
space to a comma.

Bug: 10444428
Change-Id: Ia3197045d44a2f959316935ae085575500e65459
2013-08-27 14:49:23 -07:00
Vinit Deshapnde
402334a09b Merge "Fix an exception caused by incorrect data handling" into klp-dev 2013-08-26 21:50:20 +00:00
Chong Zhang
1f3ecaae63 wifi-display: add certification options
When certification mode is enabled:

- Pass wfd session info to wifi display settings

- Allow sink to connect to source

- Add interface in display manager for pausing/resuming session

- Add interface in WifiP2pManager for setting lc, oc and starting
  autonomous GO

Note that we're compliant regardless of certification mode, but
some confusing options (eg. allowing incoming connection from
sink) we want to hide when not being tested.

Bug: 9371882
Change-Id: Icc7dcae4e046453796cfa03f5f197055fabf234b
2013-08-23 16:02:09 -07:00
Vinit Deshapnde
e8fabf98fb Additional logging to debug lost Wifi APs
This change adds some in-memory logging to get some information that
doesn't seem to get captured in bug reports readily. We can remove this
after we've got to the bottom of this issue.

This is the sort of log it produces in bugreport -

WifiConfigStore - Log Begin ----
16:30:06 - loadConfiguredNetwork GoogleGuest
16:30:06 - loadConfiguredNetworks loaded 1networks
16:30:06 - disableAllNetworks
16:30:06 - loadConfiguredNetwork GoogleGuest
16:30:06 - loadConfiguredNetworks loaded 1networks
WifiConfigStore - Log End ----

Bug: 10375978
Change-Id: Iaecd3b391aea3711bf376d6cb520217d3242e6f1
2013-08-23 11:53:40 -07:00
Vinit Deshapnde
e2a6d3df12 Merge "Introduce network link quality statistics" into klp-dev 2013-08-22 16:16:45 +00:00
Vinit Deshapnde
1f12cb52a4 Introduce network link quality statistics
This change starts tracking traffic quality data for WiFi and mobile
networks. The quality is tracked based on incidental traffic, and not
on specific measurements. Theoretical bandwidths are hard-coded, as
well as sampling interval; although sampling interval can be changed
by setting a system policy.

Bugs filed to remove shortcomings of this change -

10342372 Change LinkInfo name to something better
10342318 Move hardcoded values of MobileLinkInfo to resources
         so they can be updated without changing code

Bug: 10006249

Change-Id: I83d8c7594da20fe53abbd5e1f909b1f606b035bb
2013-08-21 13:09:01 -07:00
Vinit Deshapnde
4d0145add1 Merge "Expose WifiManager.setTdlsEnabled public API" into klp-dev 2013-08-19 19:14:03 +00:00
Vinit Deshapnde
b676a4a70d Expose WifiManager.setTdlsEnabled public API
Bug: 10221775

Change-Id: I559e4a2afd525a03c8a13fd151eca4638426d03e
2013-08-16 17:16:45 -07:00
Dmitry Shmidt
b3acd8ef26 Merge "wifi: Do not use prefix for p2p commands" into klp-dev 2013-08-16 23:45:52 +00:00
Robert Greenwalt
d3135451b1 Merge "Modify wifi BatchedScan." into klp-dev 2013-08-16 18:17:51 +00:00
Dmitry Shmidt
bbabe14333 wifi: Send event without prefix to p2p0
Bug: 9298955

Change-Id: I71037dd1cd60ee4efa75e1d6fab60a07bdf0626d
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-15 11:13:03 -07:00
Vinit Deshapnde
dda5a7152f Fix an exception caused by incorrect data handling
The prefixes in WifiEnterpriseConfig are optional, and should be treated
as such. If the prefix doesn't exist, it is possible for an
exception to be thrown (if the value size is smaller than prefix size).

Bug: 10304089

Change-Id: Id9b2bc0e371c818e35a5aa1913ee1697f167e19e
2013-08-15 10:50:18 -07:00
Robert Greenwalt
8e628dadc3 Modify wifi BatchedScan.
Add pollBatchedScan API to allow forced retrieval.
Modified driver API, adding MSCAN, removing nextCount and making
the results look more like normal manual scan results.

bug:9301872
Change-Id: I58bce0624c36e2ad8d3c3f5defcb4d4e155dc8f9
2013-08-15 08:39:13 -07:00
Dmitry Shmidt
2de3a5762f wifi: Do not use prefix for p2p commands
Bug: 9298955

Change-Id: I73dab83d133ab3a79cdf804764ba0583a6c9af7f
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-14 16:00:48 -07:00
Robert Greenwalt
7a8d9d6fec Merge "Add support for batched wifi scans." into klp-dev 2013-08-13 23:22:52 +00:00
Robert Greenwalt
0451d59ba2 Add support for batched wifi scans.
bug:9301872

Change-Id: I5a7edfdbd2b78a65119d11acad491eae350c0870
2013-08-13 14:37:37 -07:00
Vinit Deshapnde
4b2766a3d8 Fix a bug in single socket connection to Wifi Supplicant
My change to post messages without IFACE=<iface> prefix to all interfaces
was correct; but messages sent with IFACE=p2p-p2p0-0 et al were being sent
to p2p monitor only. This change mimics that to resolve some issues
introduced by the single socket change.

Bug: 10257602
Change-Id: Ia6164cb3cfd11c2a0a7b011eceaeabfd9677f62c
2013-08-12 15:54:01 -07:00
Wink Saville
89d16f7597 am 9b7b4450: am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '9b7b4450185e723dc7021f7e8bae4a12d4dd5606':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 17:10:34 -07:00
Wink Saville
9b7b445018 am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '02eab434ad9faa25291e63023b7e66698ca457a8':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 15:46:55 -07:00
Vinit Deshapnde
c249c2cc6b Use a single socket to communicate with supplicant
This helps to prepare for future updates from external sources.

Bug: 9298955

Change-Id: I4c63ad5fc1ea3564aab38cfce955de19bad75c0c
(cherry picked from commit fb40801ed8c217ae01082fb1cbd0c30bbf5532ac)
2013-08-08 18:38:53 +00:00
Jason Monk
602b232a06 Add PAC File support for proxy configuration
PAC (Proxy auto-config) files contain a single javascript function,
FindProxyForURL(url, host).  It gets called to determine what proxy should be
used for a specific request.

This adds PAC support to the system.  The ProxyProperties has been modified
to hold the PAC file when one is present.  The Proxy method
setHttpProxySystemProperty has been modified to insert a PacProxySelector
as the default ProxySelector when it is required.  This new ProxySelector
makes calls to the ConnectivityService to parse the PAC file.

The ConnectivityService and the WifiConfigStore have been modified to support
saving the extra PAC file data.

The ConnectivityService now has a class attached (PacProxyNative) that
interfaces to the native calls for PAC files.  The parsing of the PAC file
is handled by libpac (which is being added to external/) which utilizes
libv8 to parse the javascript.

As a fallback to applications that don't use the java ProxySelector,  the proxy
is setup to point to a local proxy server that will handle the pac parsing.

bug:10182711
Change-Id: I5eb8df893c632fd3e1b732385cb7720ad646f401
2013-08-07 21:01:39 -04:00
Wink Saville
d747cbc898 If in a mobile captive portal is detected enable fail fast.
When captive portal checking completes pass back the result.
This is used to enable/disable failing fast for mobile. When
failing fast is enabled we don't check for data stalls and thus
won't be continually trying to do recovery operations, such as
restarting the radio.

Bug: 9462512
Change-Id: I0dea0eee519f8ee7f94e79d40e82c18f30d7fe2e
2013-08-07 16:22:47 -07:00
Elliott Hughes
e899d7c029 am 5d6b7db5: am 20c911ba: Merge "When wifi wants ASCII lowercasing, it needs to ask for it."
* commit '5d6b7db5d9cb7de5cee45dd35af18e179f01d583':
  When wifi wants ASCII lowercasing, it needs to ask for it.
2013-08-02 09:50:44 -07:00
Elliott Hughes
ee00b353a4 When wifi wants ASCII lowercasing, it needs to ask for it.
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html

Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: Ibf25d0bbc76015cf8353ec01ab2b743cbc2bde67
2013-08-02 09:07:54 -07:00
David Christie
6942a1200c Add WorkSource capability to WifiManager for starting a scan.
Change-Id: I011bf3b91fbddaba7ab0128bb03d27d90b8a886f
2013-07-25 15:25:07 -07:00
Dmitry Shmidt
5ab422bfa3 wifi: Add tdls_discover command to tdls enable call
Bug: 8539031

Change-Id: I29739e74f73b68fbf9ff73cfc19017a01655f9a4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-07-16 12:41:22 -07:00
Vinit Deshapnde
e088428400 Merge "Allow enabling TDLS on specific routes" 2013-07-12 00:58:07 +00:00
Robert Greenwalt
d76a6851a8 am 6f2b31fc: am 56a7e4ad: am 116d4665: Merge "Block Wifi P2p discovery while doing dhcp." into jb-mr2-dev
* commit '6f2b31fcf57e4e7f5cd8af9b66619c8f5825a850':
  Block Wifi P2p discovery while doing dhcp.
2013-07-11 17:12:35 -07:00
Robert Greenwalt
6f2b31fcf5 am 56a7e4ad: am 116d4665: Merge "Block Wifi P2p discovery while doing dhcp." into jb-mr2-dev
* commit '56a7e4ad43eb5288a80b34566db365aaaa845e87':
  Block Wifi P2p discovery while doing dhcp.
2013-07-11 17:09:14 -07:00
Vinit Deshapnde
64f0d5ba15 Allow enabling TDLS on specific routes
This change exposes couple of internal APIs to enable TDLS between local
machine and a remote machine. The implementation translates client provided
remote IP to a MAC address using system ARP cache, and then instructs the
driver to enable TDLS with that endpoint. Another API takes application
specified MAC address.

Bug: 8538898

Change-Id: Ida343fc42ba3a817a4f380255596e7fb7fcdfb9b
2013-07-11 15:12:44 -07:00
Robert Greenwalt
6433ef2900 Block Wifi P2p discovery while doing dhcp.
bug:9531609
bug:9302399
Change-Id: Ie4b7c3a75245a0e7cc09fa89ddb1187d349779a1
2013-07-11 11:10:08 -07:00
Vinit Deshapnde
b8d116a580 Flush scan results et al after band change
This change flushes all bss data after a band change (because it
is potentially invalid). We do scan for new data just after we've
established connectivity on the new band.

Bug: 7053587

Change-Id: I8ab9d0bbc5c3f8f383c2b7868349634085cf94c1
2013-07-09 10:42:38 -07:00
Robert Greenwalt
505e35bca9 am c869696e: am 65f7a95f: am 2f50097a: Merge "Fix power issues around wifi scans." into jb-mr2-dev
* commit 'c869696ef3c1dca3efbc6ce8ab804e8a1b117900':
  Fix power issues around wifi scans.
2013-06-26 11:54:55 -07:00
Robert Greenwalt
c869696ef3 am 65f7a95f: am 2f50097a: Merge "Fix power issues around wifi scans." into jb-mr2-dev
* commit '65f7a95fc4c06127e7372bcb0d14e561cc23dd80':
  Fix power issues around wifi scans.
2013-06-26 10:55:00 -07:00
Robert Greenwalt
8971084258 Fix power issues around wifi scans.
- Sending a broadcast indicating when scan requests could be serviced so that
apps don't request scans we won't do anything with.
- Fix our batt stats accounting so we only count it if we send the request to
the driver.

bug: 8868201
bug: 9496690
Change-Id: I64a4f1c294c848ac64c50d8854ed4a6a1a47f603
2013-06-26 10:00:16 -07:00
Iliyan Malchev
e36b93575f am 7bc28ed7: am e6345a19: am 9233fc00: Revert "Revert "wifi: Get full scan results""
* commit '7bc28ed76b9a6591bdda37b472c3f7dc1ffae987':
  Revert "Revert "wifi: Get full scan results""
2013-06-20 20:16:51 -07:00
Iliyan Malchev
7bc28ed76b am e6345a19: am 9233fc00: Revert "Revert "wifi: Get full scan results""
* commit 'e6345a19129484572d3200edfff7f002a4314d0b':
  Revert "Revert "wifi: Get full scan results""
2013-06-20 20:15:09 -07:00
Iliyan Malchev
9233fc0023 Revert "Revert "wifi: Get full scan results""
This reverts commit c2cbd4c11bfb83344502bd80389538795bae03cb.

Change-Id: Ia1cbde588ae9706966d6340c702fcfe1a82cfa79
2013-06-21 03:10:20 +00:00
Iliyan Malchev
9c5c31d228 am 2a155213: am 66acbc22: am 0dff78aa: Merge "Revert "wifi: Get full scan results"" into jb-mr2-dev
* commit '2a155213c85f84a944551c09c0eefde3368267db':
  Revert "wifi: Get full scan results"
2013-06-18 18:21:50 -07:00