Commit Graph

1326 Commits

Author SHA1 Message Date
Roshan Pius
37aeb4700b WifiScanner: Remove pnosetting stopPno API (1/2)
BUG: 27532350
Change-Id: I6df3df56e66c7bbb8443c038cd8345989cf2d57e
2016-04-07 10:32:24 -07:00
Rubin Xu
f5c0a55d1e Fix wrong condition
am: 492ed58

* commit '492ed589df3609a15dd6a33709fc8d855ec1072d':
  Fix wrong condition

Change-Id: I23f23c4b77d19286915e501bea482e4d1fe7e714
2016-04-07 15:00:59 +00:00
Rubin Xu
492ed589df Fix wrong condition
Bug: 28050399
Change-Id: If729ee2bcc5496b5ee381e490f72c751da04dc09
2016-04-07 12:09:27 +01:00
Randy Pan
467400a23b Obsolete a couple of auto-join related APIs.
Remove the get/setHalBasedAutojoinOffset() APIs. HAL based PNO
is now enabled on all supported devices.

Bug: 26666366
Change-Id: I55b3a80a5807c33569dbbdf4dcfc2411af067567
2016-04-04 10:44:36 -07:00
Mitchell Wills
612b4c588b Merge "Send WorkSource for scan requests so the origin can be overridden" into nyc-dev 2016-03-30 21:58:44 +00:00
Mitchell Wills
133240f565 Merge "Add WifiScanner API that accepts a WorkSource for scans" into nyc-dev 2016-03-30 18:43:23 +00:00
Mitchell Wills
ad95b6a6ea Send WorkSource for scan requests so the origin can be overridden
Bug: 27903217
Change-Id: I37b24c0f5b8e9408a9f25e4479cdbb71235757a6
2016-03-29 17:36:41 -07:00
zhangshuxiao
f51097c743 When wifi ssid is empty, return WifiSsid.NONE
Issue 199610

When WifistateMachine enter Roaming State, WifiInfo
getSSID will return 0x, statusbar show "0x", because
roaming State do not update WifiInfo mWifiSsid.

Cherry pick from I241f8e9c11dc16db26cadde133043745f2f19573

BUG=27403109
TEST=compile and unittests
Signed-off-by: zhangshuxiao <zhangshuxiao@xiaomi.com>

Change-Id: Ieb7429511898a5ed3d44fd15fc1f250c122e802a
2016-03-29 16:35:47 -07:00
Mitchell Wills
d24427fabd Add WifiScanner API that accepts a WorkSource for scans
Bug: 27903217
Change-Id: I2303a2b91a4914e6cacc3108d29697f7a2dad056
2016-03-29 14:13:15 -07:00
Roshan Pius
89d9480be2 Merge changes from topic 'wifi_tx_power_levels' into nyc-dev
* changes:
  Add new wifi tx power levels in Wifi activity energy
  Add new wifi tx power levels in link layer stats
2016-03-29 18:03:37 +00:00
Rebecca Silberstein
174b140dfe Merge "Add hasEverConnected to NetworkStatus object" into nyc-dev 2016-03-29 16:04:35 +00:00
Mitchell Wills
d1f33cc950 Add accessor for buckets scanned in ScanData
Bug: 27506257
Change-Id: I9f7ae27ef8416de5e1b00dc63ee458e9e2ba69ab
2016-03-25 17:57:32 -07:00
Rebecca Silberstein
cd7167db2d Add hasEverConnected to NetworkStatus object
Add a boolean indicating if we have ever successfully connected to a
network given the current configuration.  This value should be set to
true upon a successful connection and set to false if the credentials
change.  The default value is false.

BUG: 27855896
Change-Id: I1af8f4ad7aac622b48f3c90d88b0debd671a1f40
2016-03-25 17:35:58 -07:00
Mitchell Wills
fb2d2cec7b Merge "Add bucketsScanned to ScanData" into nyc-dev 2016-03-25 20:26:50 +00:00
Paul Stewart
0a835f6e43 Merge "WifiConfiguration: Remove dead commented code" into nyc-dev 2016-03-25 03:42:10 +00:00
Paul Stewart
e8ea325716 WifiConfiguration: Remove dead commented code
Nobody uses this code.  Let's clean up.

Bug: 27054653
Change-Id: I7b3dccd09de270de6fd5a17da3217495dbce421a
2016-03-24 14:56:28 -07:00
Samuel Tan
a70cbf7f9c Merge "ScanResult: add clarifying comments to |flags| and |capabilities| fields" into nyc-dev 2016-03-24 17:46:22 +00:00
Jeremy Joslin
52f0ea56db Merge "Add meteredHint to WifiConfiguration." into nyc-dev 2016-03-24 17:27:54 +00:00
Samuel Tan
40b5617e15 ScanResult: add clarifying comments to |flags| and |capabilities| fields
Add internal comments to the |flags| and |capabilities| fields of
ScanResult to clarify their relationship to the fields in the per-BSS
scan results from WPA supplicant.

BUG: None
Change-Id: I8685283f8cc1006ffd22f2cb2ee8f8605cc0fd2b
TEST: N/A
2016-03-23 14:42:49 -07:00
Mitchell Wills
0d193b4453 Add bucketsScanned to ScanData
Bug: 27506257
Change-Id: I3ac7c2030188798ba3398de1a1253195475116f8
2016-03-22 16:53:13 -07:00
Paul Stewart
68ffbba158 Merge changes Iddeebeb8,Idd1e37a3 into nyc-dev
* changes:
  WifiManager: Use ConnectivityThread
  Create ConnectivityThread
2016-03-22 22:23:48 +00:00
Paul Stewart
ec1e5e80fc Merge "WifiManager: Defer Async Channel init" into nyc-dev 2016-03-22 19:35:07 +00:00
Jeremy Joslin
f0c9b8c68f Add meteredHint to WifiConfiguration.
Adding a new field, meteredHint, to WifiConfiguration so that it
can be passed through and eventually used to set the meteredHint
field on WifiInfo.

BUG: 27120794
Change-Id: If08966c6a5e8eab0905f3335b1c6822975b2f0b5
2016-03-22 07:56:45 -07:00
Paul Stewart
c12bb1dd8c Fix string equality comparison
Don't use "==" to compare strings.

Bug: 25624963
Change-Id: Id25696e4fdcbcf4d48ec74e8ed65c1a33716b30c
2016-03-21 11:47:42 -07:00
Paul Stewart
bf8cbb05e0 WifiManager: Use ConnectivityThread
Instead of minting it's own hander thread, have WifiManager use
the looper from ConnectivityThread.

Bug: 27432949

Change-Id: Iddeebeb8ab506c912f526c7569f304e10b9d7ab8
2016-03-19 10:05:06 -07:00
Paul Stewart
75f129e17b WifiManager: Defer Async Channel init
Now that WifiManager instances are separate and do not depend
on a single static AsyncChannel for the entire process, all
contexts within a process will create an async channel on init.
Since creating this channel requires special permissions that
some applications do not have, it is problematic for them all
to request it in the process of getting a WifiManager instance.

This CL defers AsyncChannel initialization until it is actually
going to be used.  This allows callers to create WifiManager
instances without necessarily creating an AsyncChannel.
Depending on what parts of the API will be used, some callers
will never need one.  Also, this means that these apps will
not run afoul of permissions exceptions that do not apply to
them unless they actually request functionality that requires
the AsyncChannel.

While here, this CL no longer catches SecurityException while
requesting a messenger from WifiService. That hack appeared to
be an artifact of the static instance of sAsyncChannel -- it
was not clear to WifiManager which context had permissions to
successfully create the messenger, so it was necessary to
silently fail the attempt especially since that attempt was
made in the constructor.  With the restructuring to keep
mAsyncChannel per-instance and now only created at the time
specific API calls require it, a SecurityException is
completely relevant to the caller and should not be discarded.

Bug: 27694933
Test: Boot full image, repro b/27694933 with com.google.android.music

Change-Id: I680bf2443bc5b057e629544a687f985261201ded
2016-03-19 10:05:06 -07:00
Roshan Pius
42e606250a Add new wifi tx power levels in Wifi activity energy
BUG: 27227497
Change-Id: I66db7f61a5e3a8223a008f7182bb56921145c831
2016-03-16 14:26:15 -07:00
Roshan Pius
3ec7cfeedf Add new wifi tx power levels in link layer stats
BUG: 27227497
Change-Id: I48dd88d2ab5ade8e5ad9bafa153925f4d55aba26
2016-03-16 14:07:23 -07:00
Etan Cohen
2a73c7fb2a [NAN] Refactor session lifecycle to clarify API & eliminate race conditions [DO NOT MERGE]
Bug: 27257965
Change-Id: I4d7eaa6fa1f089bed2e9185f59a37f59b530975d
2016-03-15 16:03:03 -07:00
Wei Wang
e1e3d99c46 Merge "Fix device reboot when ranging empty params." into nyc-dev 2016-03-15 21:32:03 +00:00
Etan Cohen
a5ed693788 [NAN] Removed NAN event registration - dispatch all callbacks. [DO NOT MERGE]
All events dispatched by default - there's no reason to ignore events.
The specific identity changed events for which there are use-cases to
get or ignore is controlled through a new configuration.

Bug: 27607613
Change-Id: I289a36157b55270c58311a016ef79f8746e0e0a0
2016-03-14 18:21:34 -07:00
Etan Cohen
8414f5cf2b [NAN] Consolidate publish/subscribe callback sets into single set [DO NOT MERGE]
Merge onPublishFail & onSubscribeFail into onSessionConfigFail.
Merge onPublishTerminated & onSubscribeTerminated into onSessionTerminated.
A session is either publish or subscribe (never the two) so redundant.

Bug: 27610709
Change-Id: I0282d17db88754428da25ee5f064b9a4805f9736
2016-03-14 18:21:34 -07:00
Etan Cohen
e393f57d0d [NAN] Replace session callback configuration control [DO NOT MERGE]
Controlling session callback invocation:
- Remove event registration
- Add configurations to the subset (actually just termination) which
  can be configured through the HAL

Bug: 27607613
Change-Id: I608314cc2a9b077b4d5a2d2d0d315d55c6a7724b
2016-03-14 18:21:34 -07:00
Etan Cohen
8ef7453416 [NAN] Expose match style configuration as public API. [DO NOT MERGE]
Match style allows apps to configure getting a single notification
or continuous notifications (for all matches).

Bug: 27568256
Change-Id: I9b7bd2e4e58af5c73188267d11c1288a93cf64ed
2016-03-14 18:21:34 -07:00
Wei Wang
fabae2fff0 Fix device reboot when ranging empty params.
Empty Rtt params was converted to null in
read/write paracel.

Bug:27227320

Change-Id: I7c9c897b0f7ed0ced499e9763dd56b48d209d195
2016-03-14 12:22:38 -07:00
Paul Stewart
0f3b7ac4b5 Merge "WifiManager: Remove static objects" into mm-wireless-dev
am: d292ed866c

* commit 'd292ed866c27bc7a23cfa292603d722a6b7f9d81':
  WifiManager: Remove static objects
2016-03-14 14:21:29 +00:00
Paul Stewart
d292ed866c Merge "WifiManager: Remove static objects" into mm-wireless-dev 2016-03-14 14:13:34 +00:00
Paul Stewart
a016ebbee7 WifiManager: Remove static objects
Thanks to b/24334032, we know that there can be more than one
WifiManager object per process.  Also, due to b/19159232 we know
that holding static references to contexts within WifiManager is
not okay.  This CL addresses both issues by correctly implementing
Wifimanager as the per-context CachedService as it is instantiated
in SystemServiceRegistry.

To do this, all previously static object members of WifiManager
are converted to non-static.  This is primarily safe since:

  - In processes which only instantiated WifiManager from a single
    context, the behavior is functionally identical between the
    static and non-static implementation.

  - In situations where multiple WifiManager objects were created,
    this is not a real issue:

    + sListenerKey is okay to be tracked per-instance since it
      only tracks replies for asynchronous outgoing calls for a
      single WifiManager instance (replies are not multicast to
      all instances within a pid, since replies from
      WifiServiceImpl are addressed to the other end of the
      AsyncConnection the request message came from).
    + The same is true of sListenerMap and sListenerMapLock
    + Having a per-WifiManager-instance mAsyncChannel is at worst
      a small linear increase with the number of contexts that
      use WifiManager, but for the vast majority of processes will
      not be an increase at all.
    + Having a thread per WifiManager is something that has been
      brought up in the past (b/25644527 comes to mind).  I think
      we should continue to track that particular problem there.

One static was added: an sServiceHandlerDispatchLock which ensures
that listeners from multiple ServiceHandler threads will be called
sequentially instead of interleaved.  Since ServiceHandler was
previously static, this preserves the behavior where multiple
WifiManager objects would not deliver callbacks in parallel.

BUG=19159232
BUG=24334032

Change-Id: I24125a285f97e0c5b3ca4fd721ba8ed19aa245e9
2016-03-08 09:57:06 -08:00
Glen Kuhne
ae0da24c8d Merge "Added EIDs for ERP, Supported & Extended Rates" into mm-wireless-dev
am: 45eb1bdf87

* commit '45eb1bdf8788bc2aa537ec86bc93b3bf437d9c6e':
  Added EIDs for ERP, Supported & Extended Rates
2016-03-08 16:53:34 +00:00
Glen Kuhne
45eb1bdf87 Merge "Added EIDs for ERP, Supported & Extended Rates" into mm-wireless-dev 2016-03-08 16:48:35 +00:00
Roshan Pius
4e7ad35b2f Merge "WifiScanner: Add hidden networkIds in scan setting" into mm-wireless-dev
am: d412376ca0

* commit 'd412376ca00545857df7a21829e3f674253c0567':
  WifiScanner: Add hidden networkIds in scan setting
2016-03-07 22:47:59 +00:00
Roshan Pius
d412376ca0 Merge "WifiScanner: Add hidden networkIds in scan setting" into mm-wireless-dev 2016-03-07 22:44:08 +00:00
Lorenzo Colitti
2a3ca73158 DO NOT MERGE: Move PinningNetworkCallback out to a new NetworkPinner class.
Cherry-picked from 531a344300

Bug: 19159232
Change-Id: Ic366b53259ee5944a8e864876425a6558c0a7216
2016-03-07 10:34:32 -08:00
Glen Kuhne
bff37ecdaa Added EIDs for ERP, Supported & Extended Rates
Added EIs to InformationElement to support the parsing of Supported
Rates, Extended Supported Rates, and ERP.

BUG=25691077
Change-Id: Ie540e94f9aa0dca11c3b1d6a46c5a638ec958cff
2016-03-07 08:54:07 -08:00
Roshan Pius
49b6f19ded WifiScanner: Add hidden networkIds in scan setting
Add the hidden networkId list in scan settings to be used for
connectivity scans.

BUG: 27503786
Change-Id: Ibe7eaccd84d03a7b48728e3ea1d98ccc974377ec
TEST: Compiles & unit-test passes
2016-03-06 20:22:11 -08:00
Roshan Pius
56eac13284 WifiScanner: Add PNO public API
am: e4fd150962

* commit 'e4fd150962e07dbcb0646d556bf372be0cc15f1f':
  WifiScanner: Add PNO public API
2016-03-04 22:01:04 +00:00
Roshan Pius
e4fd150962 WifiScanner: Add PNO public API
Add the public interface for starting/stopping PNO scan.

This is the internal flow that is going to be used for PNO scan:
1. Set Pno list
2. Start background scan

This flow will not work as is for supplicant, since background scan is
done manually today. So, we'll need a flag to indicate that this
background scan is targetted for PNO.

BUG: 27167559
Change-Id: I3f6921c5d03f7d9e8ad1847e57e12fb38df6c9c9
TEST: Compiles & unit-test passes
2016-03-04 13:37:48 -08:00
mukesh agrawal
d4ef42f0e5 Merge "WifiConfiguration: show more detail in toString()" into mm-wireless-dev
am: 7516adbd6d

* commit '7516adbd6d8584aff957ff722dd20543c25c6897':
  WifiConfiguration: show more detail in toString()
2016-03-03 21:22:43 +00:00
Mukesh Agrawal
7516adbd6d Merge "WifiConfiguration: show more detail in toString()" into mm-wireless-dev 2016-03-03 21:15:18 +00:00
Jeremy Joslin
b94df9db50 Merge "Revert "New systemapi to mark a wifi network as metered."" into mm-wireless-dev
am: 3f7314e331

* commit '3f7314e3310fbaddc984ae3218f7bb22f13cda11':
  Revert "New systemapi to mark a wifi network as metered."
2016-03-03 16:54:28 +00:00