818 Commits

Author SHA1 Message Date
Yuhao Zheng
72e1400e2f Merge "Add new API to scan a given channel set" 2014-02-27 03:12:06 +00:00
Yuhao Zheng
738803fee6 Add new API to scan a given channel set
Create new (hidden) APIs to scan a specified channel set. This is mainly for
location service for now, as doing frequent full scans (including DFS channel)
kills battery.

This set of new APIs contains:
- API to query available channel list for scanning, and DFS channels are marked
- API to scan a specified channel set

Selective scan results are returned in the same way as normal full scan ones.
In order not to intrude full scan results, BSS_FLUSH is NOT performed before a
selective scan. Therefore, selective scan results may contain results that's not
in the given channel set, and post-filtering may be required for location
service use.

Bug: 12610436
Change-Id: Icced18dd9b54f6dd92c0c2874d31518d56af8163
2014-02-18 15:26:29 -08:00
Felipe Leme
70a415e7fe Added support for WiFi frequency on WifiInfo (getter, settter, and frequency constant).
Bug: 12767819

Change-Id: Ib4a03919d9100861e993c733b7e478dc93dffaae
2014-02-05 18:23:22 -08:00
Vinit Deshapnde
ffadfb9ffd Move Wifi/P2p service components under services
Some methods need to be public, since frameworks/base complies before
frameworks/base/services; and services takes build dependency on base.

Similar issue exists with WifiEnterpriseConfig constants.

Bug: 9907308
Change-Id: Ied0e3dee0b25c939067dbc66867a9814b3b3b68e
2013-12-11 16:06:49 -08:00
Dmitry Shmidt
3af71e6dcf wifi: P2P: Fix WFD subelement parsing
Change-Id: Ifd802b59266760fb570fee28a6c34339a7f9fa01
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-12-11 14:55:59 -08:00
Lorenzo Colitti
4598ea4e5e am 263c4788: am 30253d7a: am 2daa0c93: Merge "Add address flags and scope to LinkAddress."
* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
  Add address flags and scope to LinkAddress.
2013-12-09 18:34:44 +00:00
Lorenzo Colitti
2daa0c93c4 Merge "Add address flags and scope to LinkAddress." 2013-12-07 02:43:04 +00:00
Lorenzo Colitti
64483947fd Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
The Android Open Source Project
ebcb32f58a Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD
Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
2013-12-05 13:10:46 -08:00
Lorenzo Colitti
317d15c155 am 4806fdfb: am f226bc60: Merge "Use LinkAddress in address notifications."
* commit '4806fdfbd0fecf91584396fc0f620c97a05ab837':
  Use LinkAddress in address notifications.
2013-12-02 20:53:06 +00:00
Lorenzo Colitti
4806fdfbd0 am f226bc60: Merge "Use LinkAddress in address notifications."
* commit 'f226bc606af9ce5aceff6b05fc4b0200c94cb248':
  Use LinkAddress in address notifications.
2013-11-26 17:56:45 -08:00
Lorenzo Colitti
5ad421a3d0 Use LinkAddress in address notifications.
Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
2013-11-26 21:55:15 +09:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Vinit Deshapnde
86513aafee Merge "Refactor WifiEnterpriseConfig and move service part in WifiConfigStore" 2013-11-19 18:47:37 +00:00
Vinit Deshapnde
5d5f5a3791 am 9dbaaab8: am daf21d76: am 75c12de0: Merge "Increase Reject threshold for disabling networks" into klp-dev
* commit '9dbaaab85eb4557b40086e6b37882af7b03725ba':
  Increase Reject threshold for disabling networks
2013-11-13 18:48:13 -08:00
Vinit Deshapnde
8fa06ee413 Increase Reject threshold for disabling networks
This change modifies a framework optimization. The framework optimization
disables a network when an access point repeatedly rejects requests
to associate with it. This change has some problems; one being that
it counts the rejects for all networks, and not for a specific network.
This incorrectly penalizes last networks at times; and since the current
threshold is 4 rejects, the probability of penalizing wrong networks
is high. This change ups that number to 16 to reduce that probability.

Bug: 11654725

Change-Id: I7150a9ccbb54bac44f2c2ba100fb6617ded33616
2013-11-13 15:48:11 -08:00
Robert Greenwalt
d528d48e5d resolved conflicts for merge of c3eef190 to master
Change-Id: I36fd3c7fcbb13e47e27ffc340484c03b5a553bb1
2013-11-07 15:05:26 -08:00
Vinit Deshapnde
ade8de3c4a Refactor WifiEnterpriseConfig and move service part in WifiConfigStore
This change moves the code related to 'importing' the configuration
in supplicant and keystore from WifiEnterpriseConfig class to
WifiConfigStore class. This would allow moving system classes
to server package.


Bug: 9989922
Change-Id: Id96f34bb5d16ef192e9174d9caa867bdfdacf803
2013-11-07 11:22:09 -08:00
Robert Greenwalt
a029ea1318 Add BatteryStats for Wifi Batched Scanning.
bug:10690989
Change-Id: Ia39b715ee6d5733970095bc76de0ed40ff8208c0
2013-11-06 17:43:18 -08:00
Robert Greenwalt
405f731a4d am 63dd9d2f: am 4802c6da: am 4d8a8392: Merge "Don\'t set same country code on supplicant again and again" into klp-dev
* commit '63dd9d2f550983d890ea21eee9b8f8619608bb79':
  Don't set same country code on supplicant again and again
2013-10-21 18:09:02 -07:00
Vinit Deshapnde
da40d92766 Don't set same country code on supplicant again and again
Setting the same code is redundant, and may cause supplicant to drop
currently connected connection.

Bug: 11303252
Change-Id: I1af57b3af2d0b8cc51939a8b9872fb3fe0105a91
2013-10-21 17:55:12 -07:00
Narayan Kamath
98e1797367 Remove captive portal code that has no effect.
Note that this CL does not change any behaviour.

At the center of this change is
CaptivePortalTracker#detectCaptivePortal(), which does nothing
except call back into ConnectivityService. Removing it allows us to
simplify code in ConnectivityService. It also allows us to remove
ConnectivityService#captivePortalCheckComplete which was only ever
called in response to this method.

While this does not change any behaviour, it preserves existing
bad behaviour, i.e, that the CAPTIVE_PORTAL_CHECK NetworkInfo
state does not correspond to actual captive portal detection.
We transition into that state and immediately (and unconditionally)
out of it and into CONNECTED.

Change-Id: Ib3797f956d2db5e3cacaaa53e899d81aa8e958af
2013-10-16 08:10:55 +00:00
Robert Greenwalt
ed22e9ce2f am dcc31551: am e9d99705: am 72dc0b43: Merge "Make Wifi Scans more heap-efficient" into klp-dev
* commit 'dcc31551f80500a096b8eb95f7f0670b4c19fd95':
  Make Wifi Scans more heap-efficient
2013-10-14 10:49:34 -07:00
Robert Greenwalt
c95d938168 Make Wifi Scans more heap-efficient
We were ending up with 1 reference to every char array
in which a new AP was discovered.  In a busy env this could
cost several hundred K from the dalvik heap.

bug:11087956
Change-Id: I3b14c39fd0c98e4aea08a406e80bcf6af40d0664
2013-10-11 14:18:26 -07:00
Narayan Kamath
6e86fa8a6b Fix WifiInfo#getHiddenSSID
The method would previously always return false.

Note that this is the simplest fix, and not the most
optimal fix. That said, in this change, a call to
WifiInfo#getHiddenSSID costs the same as a call to
WifiInfo#getSSID, so it isn't that bad.

bug: 10705138
Change-Id: I980563fd8a5bafe8c58c586449e778a0aa8b58a4
2013-10-11 10:11:14 +00:00
Yuhao Zheng
9787b10342 am 86f48113: am 623dddc9: am 3309bc5f: Merge "WifiStateMachine: fix for exiting L2ConnectedState" into klp-dev
* commit '86f48113a5ee0f2d15ba9650b4335ba063ef48ad':
  WifiStateMachine: fix for exiting L2ConnectedState
2013-10-10 09:27:55 -07:00
Yuhao Zheng
3309bc5f24 Merge "WifiStateMachine: fix for exiting L2ConnectedState" into klp-dev 2013-10-10 16:18:59 +00:00
Robert Greenwalt
6717e1d86f am 7ecedb75: am f008ca33: am f681058f: Merge "Narrow previous fix for this issue." into klp-dev
* commit '7ecedb75c833a746c561dd0029b0accf175033be':
  Narrow previous fix for this issue.
2013-10-09 17:14:37 -07:00
Yuhao Zheng
f3346191f8 am d37638e5: am 11a3bc70: am 709a4278: Merge "Don\'t mark wifi disabled unless it\'s off." into klp-dev
* commit 'd37638e5262fea65bf428cb78e73a9b4e02a93fe':
  Don't mark wifi disabled unless it's off.
2013-10-09 16:36:36 -07:00
Robert Greenwalt
8d9167ded3 Narrow previous fix for this issue.
Networks should be unconditionally disabled when going to
scan only state or we risk connecting when we don't want to.

bug:11062188
Change-Id: If89621ca07d86673a661d2e5fe4ce89286f8835e
2013-10-09 16:31:35 -07:00
Robert Greenwalt
15af21252d Don't mark wifi disabled unless it's off.
The transition from driver-started to scan-only state was incorrectly
always marking wifi disabled, but transitioning back only marked it
enabled if we were exiting due to leaving the scan-only-with-wifi-off
mode.

bug:11062188
Change-Id: I44fe64fd8dac8f36f4e22cb1c16b9d7a06bdbac0
2013-10-09 12:48:07 -07:00
Yuhao Zheng
8b033d37ca Add a missing wifi p2p discovery changed broadcast
When we disable wifi while wifi p2p peer searching is in progress, we don't get
a WIFI_P2P_DISCOVERY_CHANGED_ACTION broadcast saying that discovery is stopped.
Since this broadcast is sticky, applications will still get the previous one
saying discovery is started even if wifi p2p has been disabled. Adding a
sendP2pDiscoveryChangedBroadcast when exiting P2pEnabledState fixes this problem,
and it won't be a duplicate as sendP2pDiscoveryChangedBroadcast checks for that.

Bug: 11151666
Change-Id: I62de8f3d17d80f151403b91cf5c62866d931c01b
2013-10-09 12:28:22 -07:00
Yuhao Zheng
a9e6be83ae WifiStateMachine: fix for exiting L2ConnectedState
After a L2ConnectedState to WpsRunningState transition, network is disconnected.
However, the disconnected message is ignored by WpsRunningState, leaving DHCP
still running. When entering L2ConnectedState again, WifiStateMachine gets stuck
on waiting for DhcpStateMachine, because DHCP is already running and the command
CMD_START_DHCP is ignored. Calling handleNetworkDisconnect() when exiting
L2ConnectedState fixes this problem, plus it handles disconnection correctly.

Bug: 10900241
Change-Id: Id29e4989b29db7e64719940cf93eba1f1a90912a
2013-10-08 18:16:03 -07:00
Robert Greenwalt
3378384123 am 72566b98: am 1c6fdd6c: am cac2fd30: Merge "Revert "Use a build-specific wifi country code"" into klp-dev
* commit '72566b98dba80f21923cb6b299754d510951d611':
  Revert "Use a build-specific wifi country code"
2013-10-04 13:36:49 -07:00
Robert Greenwalt
16f3c140cb am 1db7024c: am 2e23484e: am f3f1a370: Merge "Un-deprecate getDhcpInfo" into klp-dev
* commit '1db7024c50abe49d8881d458b3317ccff3de1832':
  Un-deprecate getDhcpInfo
2013-10-04 13:36:38 -07:00
Robert Greenwalt
cac2fd302e Merge "Revert "Use a build-specific wifi country code"" into klp-dev 2013-10-04 18:33:51 +00:00
Vinit Deshapnde
1e9863f06a am 90a5192c: am e72aa641: am 3eb6e4b4: Merge "Fix EAP-TLS reconnect after reboot issue" into klp-dev
* commit '90a5192cd4af89a1b363ca25be2a63d0e57010d4':
  Fix EAP-TLS reconnect after reboot issue
2013-10-04 11:08:06 -07:00
Robert Greenwalt
cb2fe96f2c Un-deprecate getDhcpInfo
Replacement api isn't available.

bug:10003785
Change-Id: Ibe981ae90e1c6c2f1b65fa225443ae4cc92c2a3a
2013-10-04 09:53:39 -07:00
Vinit Deshapnde
3eb6e4b4e4 Merge "Fix EAP-TLS reconnect after reboot issue" into klp-dev 2013-10-03 21:19:52 +00:00
Robert Greenwalt
3ea0c99b67 Revert "Use a build-specific wifi country code"
This reverts commit c33cd23c17c24df33550a6662cedfe60b323604a.

bug:11064682
Change-Id: I35825a7005e75f3abf02f23f31dee1cb7b101c31
2013-10-03 21:15:54 +00:00
Vinit Deshapnde
a3038b2b31 Fix EAP-TLS reconnect after reboot issue
After a reboot, KeyStore is locked, and certificates encrypted with user
PIN are not accessible. So statemachines are not able to connect to
EAP-TLS networks. This change makes the problem less severe by

1. Not signing certificates with user PIN on devices with hardware backed
KeyStore.
2. Issuing a reconnect upon first USER_PRESENT event.

This means HH (which has a hardware backed keystore) can connect to
EAP-TLS networks without requiring user intervention and other devices
will automatically connect to those networks after user punches PIN.

Bug: 10325089

Change-Id: I023d60e58d8214152f051bd9ec84b85b702d829a
2013-10-02 17:26:05 -07:00
Robert Greenwalt
d29724c640 am 2b6b3d9c: am bad5d694: Merge "Use a build-specific wifi country code" into klp-dev
* commit '2b6b3d9c495d3c8332aad6515a1db06e8fde3848':
  Use a build-specific wifi country code
2013-10-01 18:50:20 -07:00
Robert Greenwalt
c33cd23c17 Use a build-specific wifi country code
This ignores any previous setting and instead uses
a value set at build time.  This does not preclude
us from using some other signal to determine country
for wifi channel limits.

bug:10513734
Change-Id: Ib82c07285af70fbd82eb0466b7391979ebc8be10
2013-09-29 15:45:47 -07:00
Vinit Deshapnde
6add2a8337 am 3d837d23: am e7d6bbd6: Merge "Fix an incorrectly created race accessing Wifi Supplicant" into klp-dev
* commit '3d837d23c5910123330fbe6d18256ecc56ac7fcb':
  Fix an incorrectly created race accessing Wifi Supplicant
2013-09-25 14:16:19 -07:00
Vinit Deshapnde
6029611e3a Fix an incorrectly created race accessing Wifi Supplicant
ScanModeState is trying to undo whatever it did in its enter(), in its
exit() function. But doing that is incorrect because it is possible to
transition to multiple states that require different conditions.

In this bug, the state machine transitioned from ScanModeState to
WaitForP2pDisabled state; in response to Stop Supplicant command. Well,
when we are trying to stop supplicant, there is clearly no need to
enable P2P or load all networks. But since this code exists in exit(),
it is executed nonetheless, causing race conditions accessing the
wpa_supplicant (WifiStateMachine is trying to shut it down, but
P2pStateMachine is trying to bring up the p2p interfaces).

We solve that problem by moving this code to the place where we transition
to DisconnectedState - since that's the state that needs this as a
precondition.

Bug: 10761752
Change-Id: Iaf0ffd8056de8533b5d2bfdf8c440fbb7e406dac
2013-09-24 17:38:09 -07:00
Vinit Deshapnde
ad93dc7f5c am 10914a23: am 662c326e: Merge "Allow yet another combination of key management options" into klp-dev
* commit '10914a23f71b42a2b9d08a0199689d84117d5e0c':
  Allow yet another combination of key management options
2013-09-24 10:22:18 -07:00
Vinit Deshapnde
662c326e5f Merge "Allow yet another combination of key management options" into klp-dev 2013-09-23 17:46:00 +00:00
Robert Greenwalt
7dadd1ed2f am 1e690b69: am 0983eadf: Merge "Fix BatchScan request coalesing" into klp-dev
* commit '1e690b693c2d4ee7ba04d5882f6b5889ada07e0a':
  Fix BatchScan request coalesing
2013-09-22 09:03:20 -07:00
Robert Greenwalt
0983eadff2 Merge "Fix BatchScan request coalesing" into klp-dev 2013-09-22 15:59:01 +00:00
Robert Greenwalt
13820af302 Fix BatchScan request coalesing
bug:10407896
Change-Id: Ic22c7d8b2a80d490d208570782a12e42d4690f5c
2013-09-20 15:30:17 -07:00