• Home
  • History
  • Annotate
  • only in /frameworks/opt/net/wifi/tests/wifitests/
History log of /frameworks/opt/net/wifi/tests/wifitests/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7209c17994c0b3bdc7c22bc312395f9aa124c231 04-Oct-2016 Erik Kline <ek@google.com> Add more capable Settings abstractions to accomodate IpManager
am: 4dbd44f394

Change-Id: I4e521144b90e13a4b123174bc899f575daa7b602
4dbd44f394d66e52d0d914618f5422013ce4eebd 04-Oct-2016 Erik Kline <ek@google.com> Add more capable Settings abstractions to accomodate IpManager

IpManager contains an AvoidBadWifiTracker which makes various settings
checks. Add a MockContentProvider with noop implementation.

Bug: 31827713
Change-Id: I9c03c379d2f94fa6f751e2f97a68a5ba1a8eea8b
rc/com/android/server/wifi/WifiStateMachineTest.java
7d7c671b6dea0c8f947afdf9300548b797db4483 23-Sep-2016 Randy Pan <zpan@google.com> Merge "WCM: forced connectivity scan" into nyc-mr1-dev
8cf5bfbee9d70dac8c83729a979bd7208a47d44d 21-Sep-2016 Randy Pan <zpan@google.com> WCM: forced connectivity scan

WCM starts a full band single scan when user forces a connectivity
scan and wait for the full band scan results to make network
selection.

Bug: 30897947
Test: unit tests and manual test
Change-Id: Ie220c25dd60a0534afbf33f62691f32515f7062b
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
d76a14997a969ea44daa47756dcc8f83aee96935 20-Sep-2016 Mitchell Wills <mwills@google.com> Ignore disconnect messages that don't indicate the channel is dead

Bug: 29368784
Test: mmma frameworks/opt/net/wifi/tests && runtest frameworks-wifi
Change-Id: I5ae3665898565379b101c4ac0c5570c9debb1228
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
5e816a8c6f96076f69dd8bbb0110203d92940c4e 20-Sep-2016 Glen Kuhne <kuh@google.com> Merge "Wifi Metrics: dumpsys arg for clean output" into nyc-mr1-dev
9ff7dea01b09f658492b7b8fa122695e56d28cdc 17-Sep-2016 Glen Kuhne <kuh@google.com> Wifi Metrics: dumpsys arg for clean output

Modify the way dumpsys works in wifi so that
'dumpsys wifi wifiMetricsProto clean'
outputs only serialized base64 encoded wifi metrics proto bytes.

BUG=31556602
Test: Created new unit test

Change-Id: Id1aa319a03a5e2bcffb1276057cb770679015abd
rc/com/android/server/wifi/WifiMetricsTest.java
891bba121efd35038a2b17744779acc01ead8ad0 12-Sep-2016 Mitchell Wills <mwills@google.com> Merge "Add a flag to indicate if a ScanData is for a scan for all channels" into nyc-mr1-dev
4e1f32efceee1db37bfb1e2624b434dbfb055686 07-Sep-2016 Mitchell Wills <mwills@google.com> Add a flag to indicate if a ScanData is for a scan for all channels

BUG=30897947

Change-Id: I989a25dd3df3f473090b76b4e3cb798a2d513490
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/scanner/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
rc/com/android/server/wifi/scanner/NoBandChannelHelperTest.java
rc/com/android/server/wifi/scanner/SupplicantPnoScannerTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
fbc0f388aacac432f5abfadfd25e212d5e4b159b 08-Sep-2016 Randy Pan <zpan@google.com> QNS: currently connected network BSSID

Always get the currently conntect network BSSID from WifiInfo in
case that firmware roaming switched the device to a different
BSSID than the one previously chosen by QNS.

Bug: 31317902
Change-Id: I6f69144e2a386481d127dbd1ba997e2879c6e000
Tests: unit tests and manual test
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
22fcd83c560e45deaadb22795dd2683ebd923914 15-Aug-2016 Sohani Rao <sohanirao@google.com> Define and track Wifi scores to report Wifi metrics

Add a proto definition to track counts corresponding to wifi scores
Scores are calculated in WifiScoreReport and metrics are updated in
calculateAndReportScore. Wifi scores are limited in a range [0, 60]
where the max score is the base score assigned by Network Agent.
To ensure the size of the map is limited, any scores out of this
range will be dropped. Updated test framework to validate score
tracking and check out of bound values are dropped. The unit tests
also ensure the base score is within reasonable limits.
Merge details:
This is a merge from CL 1326502 on master. Merge conflicts were
mainly due to code placement and only major difference was the call
to calculateScore as it has different arguments on the branches.

BUG=29418013

Change-Id: Iaf22ed7dc7fb73413739507406ec88d7719b362e
TEST=Wifi Unit tests, Walk tests and log scores via dumpsys
DEVICE=angler
rc/com/android/server/wifi/WifiMetricsTest.java
7a36be372edfa3f7fe0e37320b9b21a5fbadf277 01-Aug-2016 Glen Kuhne <kuh@google.com> WiFiMetrics: Count hidden & passpoint networks

1. Extended the WiFiMetrics proto to include counts for hidden and
passpoint networks, counting these for all saved networks, connections
and scan results.
2. Extended the counting of Open, Personal and Enterprise network to
include scans.
3. Extended ConnectionEvent logging to detect and flag passpoint network
connections.
4. Implemented the checks that detect if a scan Result is a hidden network.
While I was here: Cleaned up a couple old WifiMetrics <TODO>s, which we will not be doing.
BUG=28634987

Change-Id: I2e22bf8d79ccbda84ead700272ff0f1b0f13d2e7
Test: Extended unit tests, executed manually
rc/com/android/server/wifi/WifiMetricsTest.java
1c50de232acb3d6148c454941a6b9a79e0663b81 26-Jul-2016 Glen Kuhne <kuh@google.com> WiFiMetrics: Add LastResortWatchdog success metric

Added a metric that tracks how often WifiLastResortWatchdog triggers
successfully fix wifi, allowing wifi to connect to a network after
triggering. It does not count a success, if the connection occurs
after a new network becomes available.

BUG=30407550
TEST=Unit Tests

Change-Id: I68d1f003fee9eb8074c04db141bd7b5c3089d57b
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
rc/com/android/server/wifi/WifiMetricsTest.java
a284841edf33e4070748816a034c47f996bfeb81 12-Aug-2016 mukesh agrawal <quiche@google.com> WifiMetrics: add metric for alert reasons

Add metric to track the number of alerts triggered
by Wifi driver/firmware. This will give us a
concrete measurement of stability in the field.

BUG=29158746
TEST=tests/wifitests/runtests.sh

Change-Id: I435e5d792a97c197fe685e5b2c05d7b8efda62f0
rc/com/android/server/wifi/WifiMetricsTest.java
8bc512d77b002fdd4a4a920ab8737e70f74a4f0d 22-Aug-2016 Randy Pan <zpan@google.com> Merge "Fix WiFiNetworkAgent#unwanted" into nyc-mr1-dev
1bf983a4211f547593a60523e43112ecdb5c8997 15-Aug-2016 Roshan Pius <rpius@google.com> SupplicantWifiScannerImpl: Restart PNO on settings change

When a new network is added, ConnectivityManager will stop/restart PNO
scans. However because of the 5 second debounce logic in HwPnoDebouncer,
this toggle will not be sent to wpa_supplicant. So, force restart PNO in
SupplicantWifiScannerImpl whenever there is a change in the network list .

PS: wpa_supplicant already has some internal logic to handle network
additions when PNO scans are running. But, not sure if this is working
as intended.

BUG: 30833790
Change-Id: Ib328abd866298a8a672a2f19fc863ee515dcbe74
TEST: Added unit tests
rc/com/android/server/wifi/scanner/SupplicantPnoScannerTest.java
e483fd4a3151e59b3d0a596572b4d9f035fa8424 09-Aug-2016 Roshan Pius <rpius@google.com> SupplicantWifiScannerImpl: Ignore PNO stop failure

Ignore PNO stop failures when resetting the |mCurrentPnoState| flag. The
stop PNO command failure indicates that wpa_supplicant has already
stopped PNO scan internally. So, we should reset our flag to reflect that.
Otherwise, the next attempt to turn on PNO scans will be silently ignored by
|SupplicantWifiScannerImpl|.

BUG: 30764879
Change-Id: If75993ebe3bfc853628a96a698bb5806f0da5962
TEST: Unit tests
TEST: `act.py -c connectivity_basic.config -tb basic_wifi_tethering -tc
TelLiveDataTest:test_lte_wifi_switching`
rc/com/android/server/wifi/scanner/SupplicantPnoScannerTest.java
173dae04272c1b40488292f6392a922b4c4b2949 05-Aug-2016 Rebecca Silberstein <silberst@google.com> WifiStateMachine: update new mode in initial state

When WifiController calls setOperationalMode a CMD_SET_OPERATIONAL_MODE
message is sent to WifiStateMachine. When this message is received in
the InitialState, it is not handled where it is then dropped in the
default state. Dropping this message causes WifiController and
WifiStateMachine to get out of sync on the operating mode.

BUG:29938263
Change-Id: I8481af8d6826f3da18f5762833a7b145d81b74dd
TEST:runtest frameworks-wifi
rc/com/android/server/wifi/WifiStateMachineTest.java
c4d044acc589188f25b8dcd962db52e1fc08fe8d 27-Jul-2016 Randy Pan <zpan@google.com> Fix WiFiNetworkAgent#unwanted

1) No longer blacklist a network when it's unwanted by NetworkAgent.
2) Deprecate the network disable reason BAD_LINK.
3) Stop WiFi Auto_Connect attempt if neither saved Wifi network nor
untrusted WiFi network is requested.

Bug: 28558417
Tests: Unit Tests and manual tests
Change-Id: I2b245cfb357b92ed925d89603e0fefded9d6865a
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
24750cd1f8148d6a935bda96f3b17f22b0c1d8bd 03-Aug-2016 Rebecca Silberstein <silberst@google.com> WifiController: correct active state after ap mode

When a device is in AP mode and wifi is toggled, the device should end
the wifi hotspot and enter the connect mode for wifi. When wifi was
toggled in ApEnabledState, a wifi toggle would trigger a switch to
StaEnabledState. This state's enter method would trigger
WifiStateMachine to start supplicant, but would not indicate it should
be in connect mode. This is done by DeviceActiveState. This CL switches
the mPendingState in ApEnabledState from StaEnabledState to
DeviceActiveState.

Added a test to WifiControllerTest to cover this situation.

BUG: 30042498
Change-Id: I0792c06521e82e07a8c36648ebbd62c8babceaff
TEST: runtest frameworks-wifi
rc/com/android/server/wifi/WifiControllerTest.java
83fc97d72a76fc522b774e79ad871b951560d33a 27-Jul-2016 Ningyuan Wang <nywang@google.com> Merge "Fix tethering failure when wifi is not started" into nyc-mr1-dev
828b94eca5e0ffa67448f67a9dfb4d7eb492312a 23-Jul-2016 Randy Pan <zpan@google.com> QNS: candidate network BSSID

QNS recommends a network for WCM to connect or roam to by
returning that network's configuration with the BSSID stored
in the 'candidate' field.

In a corner case that if 1) two APs are within the same network
(SSID), 2) the two APs get exactly the same QNS score (one AP has
higher RSSI value but 2.4GHz, and the other is 5GHz but lower RSSI),
and 3) the 5GHz AP shows up in the scan results before the 2.4GHz AP,
QNS sets the wrong BSSID value. This change fixes that problem.

Bug: 30184472
Change-Id: I8c67ab194571ba17b853eae617fb659017f72969
Test: WiFi Framework Unit Tests & manual tests
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
37b06cd7aae7fe27cfaf1d95cc9901548765406b 20-Jul-2016 Ningyuan Wang <nywang@google.com> Fix tethering failure when wifi is not started

getCurrentCountryCode() returns the country code which we already
sent to driver.

However, sometimes when wifi and location scan are not started,
we have a valid country code but we didn't set it. In this case
getCurrentCountryCode() returns null. This will confuse SoftApManager
and break tethering. This also causes WifiApDialog not to show 5GHz
option in the UI when user creates a new wifi hotspot config.

In this CL we fix the incorrectly reported country code by adding a
function getCountryCode() which returns a valid country code regardless
of was it sent to driver or not.
SoftApManager and WifiApDialog will use this function to make decisions.

In addition, we also rename getCurrentCountryCode() to getCountryCode
SentToDriver() for better readability.

BUG=30200338
TEST=compile
TEST=unit tests
TEST=manual tests

Change-Id: I5ba576509f9f401f4d57a4628a147ac8871552c0
rc/com/android/server/wifi/WifiCountryCodeTest.java
5382acb5eb3a0448a32651dcc7fe9fd634ce0e38 20-Jul-2016 Roshan Pius <rpius@google.com> WifiScanningServiceImpl: Add ClientInfo null checks

Add missing null checks for |ClientInfo| in a few places. ClientInfo
could end up being null if there was a pending cleanup of the client
before processing of the request in the appropriate state machine.

Also, add a unit test to simulate the scenario in the bug specified.

BUG: 30241457
Change-Id: Ic4412ae03b5176764b10cba357d19086c0c09e6e
TEST: Unit tests
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
20d76f6f2f264cc27a8821e46ad1bd1dc50700e7 23-Jun-2016 mukesh agrawal <quiche@google.com> WifiConfigManager: move dumping of LocalLog

The dump() method of WifiConfigManager dumps the
LocalLog that's used by WCM. That would make sense,
except that the LocalLog that WCM uses isn't actually
owned by WCM.

Instead, the LocalLog is allocated by WifiNative, and
shared by multiple objects. (The sharing is safe, because
LocalLog's methods are synchronized.)

Since the LocalLog in question is a shared facility,
let's move dumping of the LocalLog to WifiLogger.

BUG=29424414
TEST=unit tests
TEST=manual

Manual test
$ adb bugreport foo.zip
$ unzip foo.zip
$ grep 'WifiNative LocalLog' bugreport*.txt
-> expect a match

Change-Id: I291ac29385472fd0e56fcb522d818dcffcedfe36
(cherry picked from commit 6b42d03b9d92d6167a0629b042b2a3c2e2489a1b)
rc/com/android/server/wifi/WifiLoggerTest.java
21d43031a1141caae823977a1e1015b596f47895 29-Jun-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiLogger: use R for ring buffer sizing" into nyc-mr1-dev
9a53ff620c9281be423227bc48378d9aad3f37e0 29-Jun-2016 Rebecca Silberstein <silberst@google.com> Merge changes from topic 'cherrypickWifiWatchdogResetOnTrigger' into nyc-mr1-dev

* changes:
DO NOT MERGE WifiLastResortWatchdog: reset wifi on trigger
DO NOT MERGE WifiController: Add CMD_RESET_WIFI command
DO NOT MERGE WifiLockManager: create class to manage WifiLocks
e1db4e04054d8cc302fb96c4f78370845650504e 23-Jun-2016 mukesh agrawal <quiche@google.com> WifiLogger: use R for ring buffer sizing

Use Resources to determine ring-buffer sizing.
This is to support board-specific ring-buffer
sizes.

BUG=29225988
TEST=unit tests
TEST=manual

Manual test (bullhead): Added some Log.e() statements,
and verified that RING_BUFFER_BYTE_LIMIT_SMALL and
RING_BUFFER_BYTE_LIMIT_LARGE were 32KB and 1024KB,
respectively.

Change-Id: I25ee7d871609c4ebe186424bfdd324a8283f43e3
(cherry picked from commit eacd212af097fada70bdb49da3ed06e8d172237b)
rc/com/android/server/wifi/WifiLoggerTest.java
969de309e3edc1795d6df24415e586d1a1587cb6 27-May-2016 Rebecca Silberstein <silberst@google.com> DO NOT MERGE WifiLastResortWatchdog: reset wifi on trigger

( cherry-pick of Icb7c3a211afcd234cfcd25a42665aed03c33f5e1 from master )

Added wifi reset on WifiLastResortTrigger. The reset is implemented by
sending the CMD_RESTART_WIFI message to WifiController.

BUG: 27856267
Change-Id: Icb7c3a211afcd234cfcd25a42665aed03c33f5e1
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
5f0238c0d7b4b037dcb1c397217eb65dcfbf53ce 26-May-2016 Rebecca Silberstein <silberst@google.com> DO NOT MERGE WifiController: Add CMD_RESET_WIFI command

(cherry-pick from master)

Allow WifiController to safely restart the WiFi stack. This will
initially be used by the WifiLastResortWatchdog. The CMD_RESET_WIFI
message is only handled in the StaEnabledState where it would have been
attempting to connect. The process of bringing the wifi back up is
handled through the use of the new CMD_RESET_WIFI_CONTINUE command.
Tests are also added to verify that the new CMD_RESET_WIFI command
is ignored in other states (explicitly tests Emergency mode and
AP enabled).

BUG: 27856267
Change-Id: I778ccd6f7d555f6ee6abb195c1c16c106c2e66b7
rc/com/android/server/wifi/WifiControllerTest.java
9563500603c158373e2ee512c4d451783c104660 20-May-2016 Rebecca Silberstein <silberst@google.com> DO NOT MERGE WifiLockManager: create class to manage WifiLocks

( cherry-pick of Ib055078eb0a8555e9a7715d7ce10de1103e73130 from master)

Create new class to maintain WifiLocks requested by applications.

WifiLock management was closely tied to the WifiServiceImpl and made it
very difficult to write tests using different WifiLock modes in
DeviceIdle states. This CL moves the lock management to a new class,
WifiLockManager, and adds tests to check the behavior.

Bug: 28669096
Change-Id: Ib055078eb0a8555e9a7715d7ce10de1103e73130
Test: runtest frameworks-wifi
rc/com/android/server/wifi/WifiControllerTest.java
rc/com/android/server/wifi/WifiLockManagerTest.java
cb26f07ae9c558f8c6136c951a7f633d0ccfe79f 24-Jun-2016 Randy Pan <zpan@google.com> WCM: Listen to all single scan results

In addition to single scan results initiated by WCM itself, it
listens to the single scans requested by other modules as well.
This gives us more opportunities to connect to a network.

We don't check if a single scan is scheduled by WCM watchdog
any more since we now listen to all single scan results.

Bug: 29606099
Tests: Wifi Framework Unit Test & manual tests
Change-Id: I2a1df0337005878f415eccc425600267434c2e54
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
450fee26a21eb56d536df147d3e88d3549f807c0 27-Jun-2016 Mitchell Wills <mwills@google.com> Merge "Add a WifiScanner API to listen for ongoing scans" into nyc-mr1-dev
1ba04405f98489f0fbd66b6566c64324be11111a 23-Jun-2016 Mitchell Wills <mwills@google.com> Add a WifiScanner API to listen for ongoing scans

Bug: 29412469
Change-Id: I1b8c6f3524e937cbc902af0be391b5e6b23e8ee2
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
3c8094ab45f3320dbe45e6460c5d62dcc24ce7ae 04-May-2016 Mitchell Wills <mwills@google.com> Clear auth identity if sim removed while the device is off

TEST: Validated that changing a SIM both when the device is on and when
it is off results in the correct identity being used when trying
to authenticate with an EAP-SIM network.
Fixes: 28163651
Change-Id: I3dda95308a527be225a9f70636c727c9826ac939
rc/com/android/server/wifi/WifiConfigStoreTest.java
55b1b58e72df2362888c7a1c60ad76a43523bfcf 25-Jun-2016 Mitchell Wills <mwills@google.com> Merge "Reuse single scan results if a request comes in during an ongoing scan" into nyc-mr1-dev
5751e82f645ab5b4366c63e0fbc561534c1cb3b8 22-Jun-2016 Mitchell Wills <mwills@google.com> Reuse single scan results if a request comes in during an ongoing scan

Change-Id: I590c64a4718385214e4ba803112ed7283f69b3be
Fixes: 28936380
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
af2c07c305e33b759b3b0e707fdc264b193626c4 22-Jun-2016 Glen Kuhne <kuh@google.com> Merge "Wifi Metrics: Log RSSI polls" into nyc-mr1-dev
7a0b9ffe794113c4a5ed528d8aadeb3303d1b089 10-Jun-2016 Glen Kuhne <kuh@google.com> Wifi Metrics: Log RSSI polls

Added logging of the periodic RSSI polls into wifi metrics, as a
key-value histogram (count per rssi level).

BUG=29247576

Change-Id: I9aa19dbf0891b87d1d12a375aeb3771ba7ef6308
rc/com/android/server/wifi/WifiMetricsTest.java
de5fadf2e5c7bb769705c830efb04133b1e0219d 21-Jun-2016 Randy Pan <zpan@google.com> WCM: reset connectivity scan retry counter

Move the scan retry count reset to where scan results are received.
This is to deal with the case that WifiScanner reports success when
a scan request is queued but later fails to be executed.

Add a unit test case to verify the retry behavior.

Bug: 29523369
Change-Id: Ibcd7c771a8efa78612a84021a4511db621f4451e
Tests: Wifi Framework Unit Tests & manual tests
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
9e7f5e0a47a9a4aa519a50d9a0959547c1c604f1 15-Jun-2016 Mitchell Wills <mwills@google.com> Better distinguish between WifiScanner clients in logs

Change-Id: I15327935f4b9ccdf3d3244087c508f19fd275c1f
Fixes: 29385784
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
e1b848bb11cc44060328bf53162cb776e3dd54dc 13-Jun-2016 Glen Kuhne <kuh@google.com> Merge \"DO NOT MERGE WifiMetrics: Record capture duration\" into nyc-dev
am: 622e9ff387

Change-Id: Ie7de4f9173a815abe88f91efc5a46893be5270d1
622e9ff3874251022ae3c27548bc5a2f77bdc8bc 13-Jun-2016 Glen Kuhne <kuh@google.com> Merge "DO NOT MERGE WifiMetrics: Record capture duration" into nyc-dev
e8f7d4ab151251991982329f7274f866bb03b3da 11-Jun-2016 Mitchell Wills <mwills@google.com> Fix crash when cleaning up WifiScanner client before Wifi enabled
am: 3040b86393

Change-Id: Ied0c5e048cceba8f4935e8dd9bdc104db6b64366
3040b86393a04bc939a5a94cda4169b0293dfac7 10-Jun-2016 Mitchell Wills <mwills@google.com> Fix crash when cleaning up WifiScanner client before Wifi enabled

Change-Id: Ia212840fcf781740d5e185d3e3c2e30a477e25f0
Fixes: 29250616
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
49410c13ba2284fb7c836fd3527dc526ea5681a0 07-Jun-2016 Glen Kuhne <kuh@google.com> DO NOT MERGE WifiMetrics: Record capture duration

Adds a wifi metric that records the capture duration period represented
by the WifiLog proto. This is to improve the way wifiLogs are weighted when
aggregated.
Modified WifiMetrics to use the Clock wrapper of SystemClock to
facilitate unit tests.

BUG=29185886

Change-Id: I61dd2b481c26f0ea21bcb280ce1d40f3d73b7625
rc/com/android/server/wifi/WifiMetricsTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
497b04c439e7dd2b61a796e6a4da04452c46e69a 09-Jun-2016 mukesh agrawal <quiche@google.com> WifiLogger: revert large ringbuffers for userdebug/eng
am: 9a865ec91c

Change-Id: I727e2175df055a2485dd7071e568f676afa0f40c
76d591d5abba138d5104cbadd5c30c6e7c567194 08-Jun-2016 Christopher Wiley <wiley@google.com> Merge "Remove all knowledge of tethering from SoftApManager" into nyc-mr1-dev
9a865ec91cf32d41496a28d800279cd86832b027 18-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: revert large ringbuffers for userdebug/eng

When the WiFi code is sufficiently mature, we'll use
this patch to return to using small ring buffers
on all builds.

Note that this patch is not a literal/full revert of
CL:1048267. The reason for the more focused change
is to minimize merge conflicts, in case other code
changes by the time this CL lands.

BUG=28822174
TEST=unit tests

Change-Id: I9facadf8aaf779e0627b15815a426b86bde692a1
rc/com/android/server/wifi/WifiLoggerTest.java
a68f3e359ac27285b10332ea2461469e5e03bfd4 08-Jun-2016 Randy Pan <zpan@google.com> WCM: No connectivity scan if auto roaming is off

When WiFi is already connected, WCM initiates connectivity scan
for roaming only if config 'EnableAutoJoinWhenAssociated" is
turned on. This config option is turned on by default. More
power sensitive devices can turn the config off to save battery.

Note, when this config option is turned off, only the WCM
initiated auto roaming is disabled. Wifi chipset firmware may
still perform a roaming on its own.

Bug: 29157340
Change-Id: I9a8f0df65d39412f242c064db5b3d6654d23634c
Test: Framework Unit Tests and manual tests
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
d9c55738e1bb2ff3faee24c5434453352a9e6611 31-May-2016 Christopher Wiley <wiley@google.com> Remove all knowledge of tethering from SoftApManager

( dirty cherry-pick from f502d3e20409d81cfefd762b3b44f46dead09a92 )

This logic has moved into Tethering and TetherInterfaceStatemachine,
where it probably always belonged.

Bug: 29054780
Test: WiFi tethering continues to work on angler
`runtest frameworks-wifi` passes.

Change-Id: Ifff78ea540929fde4abea65716e1f659da2ecfec
rc/com/android/server/wifi/SoftApManagerTest.java
ff6f1149718d709ce4799883af4d77251c2652dc 07-Jun-2016 Ningyuan Wang <nywang@google.com> Merge "Continue supporting persisting country code" into nyc-dev
0091305175e8c6fe7fc6d01efb9d405961db4ac7 03-Jun-2016 Ningyuan Wang <nywang@google.com> Continue supporting persisting country code

Some devices rely on Setup Wizard to set a persistent country
code.
This CL honors the persistent option, fixing corresponding 5GHz AP
problem.
This also includes addtional unit tests for this change.

BUG=28127280
TEST=compile
TEST=runtest frameworks-wifi
Change-Id: I2f36216e143d0ac4959f26a9965def061a06aabf
rc/com/android/server/wifi/WifiCountryCodeTest.java
016ca1ae5e33eb9529ae10c2510a56fa5c7fec4d 03-Jun-2016 Randy Pan <zpan@google.com> WCM: Periodic scan interval policy adjustment

Allow immediate single scan for scenarios such as user allows
untrusted networks, user forces a connectivity scan, and etc.
The minimum scan interval is enforced only for the screen state
change and connection state change cases.

Also removed the scan started by WCM for user selected network.
We connect to the user selected network by directly invoking
the wpa_supplicant select_network. Now WCM always sets the
'forceSelectNetwork' parameter to false when calling into
WifiQualifiedNetworkSelector.selectQualifiedNetwork(). So deleted
the unused variable mForceSelectNetwork.

Bug: 29103349
Change-Id: I1dd77af0cf7de85a96afac63de1344daab192968
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
e733ddab5260b153ad76ed73a672de928d0f4b37 26-May-2016 Mitchell Wills <mwills@google.com> Fix WifiScanner tests after parameter adjustment

Change-Id: Ia18913aed38ff5fa7655878340b99e15132a32d1
Fixes: 28970259
rc/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
c2963eb07660a06592c60224279685166390217d 23-May-2016 Randy Pan <zpan@google.com> WifiConnectivityManager: enforce minimum single scan interval

Instead of always starting a single scan when the device enters
screen on state, we now keep track of how long it has been since
last periodic single scan and defer the new scan request.

Bug: 28887789
Tests: Wifi Unit Tests, manual tests
Change-Id: Iba5b5b7db897d3227d87f8d989246a1942525b9c
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
1f9f7c109ca952884fb7bff7271669d879ce9b97 23-May-2016 Mitchell Wills <mwills@google.com> Merge "Make sure that all ways a scan can fail get logged" into nyc-dev
9d6a7a1b5f9e9ea194fc6b15044c9d14d6aefabf 21-May-2016 Roshan Pius <rpius@google.com> Merge changes Ie64c11f3,I91272aa5 into nyc-dev

* changes:
WifiNetworHistory: Don't persist QNS blacklist
Change clock for time interval/elapsed measurments
a2cc7092156cb3280fa4b9c1d832e5d1ed2855a4 21-May-2016 Roshan Pius <rpius@google.com> Merge "WifiConnectivityManager: Fall back to full band scan" into nyc-dev
56820e92fd4b1a0cee83f552905fc76fc8290146 20-May-2016 Mitchell Wills <mwills@google.com> Make sure that all ways a scan can fail get logged

Bug: 28682351
Change-Id: If9296d862adbd479e8600699f06f4684d377ae6a
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
61d025c1d760de811fd62e3b2d376b47d61d10a1 20-May-2016 Mitchell Wills <mwills@google.com> Merge "Add tests to verify single scan blame behavior" into nyc-dev
fb196453c07daad5e525520cecad84cec5d89fb7 20-May-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Fall back to full band scan

Fall back to full band scan when the currently connected network is not
present in scan result cache. This could be a transient problem, but we
don't want to cause an error by sending an invalid scan request.

Changes needed for unit-testing this change:
1. Make WifiInfo a real instance so that we can set the values for the
public members directly accessed like tx/rx success rate.
2. Make |getCurrentWifiConfiguration| public so that it can be stubbed
out.

BUG: 28845855
TEST: Compiles & unit-test passes
Change-Id: I6cb2b7ad762b3f8f2ab36d66c4b1fcc39fafffed
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
ee0ab818341d44614ffe56ae73ecc08b974c2cbb 20-May-2016 Roshan Pius <rpius@google.com> Change clock for time interval/elapsed measurments

1. Use the clock retrieved from WifiInjector in more modules: QNS,
Scanner, WifiConfigManager.
2. Use |elapsedRealtime| for time interval/elapsed measurments. Things
like scan results, config elements still continue to use
|currentTimeMillis|

Also,
1. Had to make |tryEnableQualifiedNetwork| public to prevent mockito from
calling the real method in WifiConfigManager.
2. Move keystore also into WifiInjector.

BUG: 28299258
BUG: 28824635
Change-Id: I91272aa5665abb741da7530d8920d09c8c5ea41f
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
rc/com/android/server/wifi/scanner/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/scanner/HalWifiScannerTest.java
rc/com/android/server/wifi/scanner/SupplicantPnoScannerTest.java
rc/com/android/server/wifi/scanner/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
1bf155710ada7a6ee27453a120690d2c91a0fec5 19-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: fetch packet fate on dump()

We've observed that it's tricky to detect when a connection
fails. Consequently, even if the user is careful to generate
a bugreport while the device is in the failed state, the
bugreport will not include packet fate data for the most
recent connection.

Improve the utility of packet fate, by fetching the most
recent fate on the call to dump(). With this change in place,
we'll get packet fates for the most recent connection
attempt (even if it's still in progress).

BUG=28849396
TEST=unit tests, manual

Manual test
- configure bullhead for open network
- configure bullhead for wpa-2 network, wrong password
- let bullhead fail connecting to wpa-2 network
- let bullhead succeed connecting to open network
$ adb dumpsys > /tmp/dumpsys
$ grep 'fates ---' /tmp/dumpsys
--------------------- Last failed connection fates ----------------------
--------------------- Latest fates ----------------------

Change-Id: Iaeb2584020f70ac5d2f3139bac72ea07a7ddce81
rc/com/android/server/wifi/WifiLoggerTest.java
30c88d6ec01c9f871ac62c6c7038bc99c2a6f7d8 19-May-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiNative: add wallclock timestamps for packet fate" into nyc-dev
eaf6303a081b4a7f2231b5053099da7a1c16b7bd 18-May-2016 mukesh agrawal <quiche@google.com> WifiNative: add wallclock timestamps for packet fate

Packet fate reports are timestampped in a different format than
logcat messages. This makes it hard to correlate packet fate
summaries with other system activity.

Resolve this, by adding wall-clock timestamps to packet fate
summaries.

BUG=28701632
TEST=manual test

Manual test:
- set bullhead to non-GMT timezone
- install build on bullhead
- trigger connection failure
- verify that walltime column is in the right ballpark,
relative to logcat messages

Change-Id: I3aed8d9acca42f0ef0cc4f2f2fbdabdde33ce4c8
rc/com/android/server/wifi/WifiLoggerTest.java
rc/com/android/server/wifi/WifiNativeTest.java
bf984686a38b0574c18f728a21dfadf620d5e427 19-May-2016 Mitchell Wills <mwills@google.com> Merge "Fix crash when scanner gets results that don't match the request" into nyc-dev
43d1480fe5ec04f3dec53cbe9d6c46186ddc8d44 18-May-2016 Mukesh Agrawal <quiche@google.com> Merge changes I5884dee0,I6f4cb00c into nyc-dev

* changes:
WifiLogger: use large ringbuffers on eng/userdebug
WifiService: add build properties abstraction
1345d63ec537cc75b8daf9cafbb8b1fd78338ec5 18-May-2016 Mitchell Wills <mwills@google.com> Add tests to verify single scan blame behavior

Bug: 28320003
Change-Id: I4cfdedb1d5c3c29608208bb1c3bda42f4759fb7f
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
8df302f5b9c647f69acee24e09fa20d8b5c54c4a 18-May-2016 mukesh agrawal <quiche@google.com> WifiLogger: use large ringbuffers on eng/userdebug

We're having trouble resolving some field reports, due
to insufficient time coverage in the HAL ring buffers.

Increase the ringbuffer size of eng/userdebug builds,
to make it easier to debug issues reported by
dogfooders.

This change will be reverted closer to launch.
(b/28822174 has been filed for the reversion.)

BUG=28729317
TEST=unit tests

Change-Id: I5884dee05db79245d211a457ff44b5e7b96ddbcb
rc/com/android/server/wifi/WifiLoggerTest.java
b6d6e31dc6ed9a9a0178990a0cec8edb9ad36c77 18-May-2016 mukesh agrawal <quiche@google.com> WifiService: add build properties abstraction

As it turns out, WifiStateMachine isn't the only thing that
wants to change its logging behavior depending on
Build.TYPE.

1) Add an abstraction of Build.TYPE, so that we can
a) check build type in a common way, and
b) test the logging behavior across build types
2) Migrate WifiStateMachine to use this new abstraction.

BUG=28822027
TEST=unit tests

Change-Id: I6f4cb00ccb5f3a4b9a5b67e69f8365aab7fd429c
rc/com/android/server/wifi/WifiStateMachineTest.java
ac90f832cc7efcbe0a7a2ec24d8d45192e3ecc66 18-May-2016 Randy Pan <zpan@google.com> Merge changes from topic 'exponential backoff periodic scan' into nyc-dev

* changes:
WifiConfigManager: clean up makeChannelList()
WifiStateMachine: clean up dead code
WifiConnectivityManagerTest: exponential backoff periodic scan
Restrict connectivty periodic scan
f5cdd8e7a6b7d4c0b5f77134273c7e894d8c087b 16-May-2016 Mitchell Wills <mwills@google.com> Fix crash when scanner gets results that don't match the request

Before this, when WifiScanningService processed single scan results from
supplicant that only contained results that did not match a request the
filter code would return null indicating that the results should not be
delivered, causing a NPE later. This change updates the meaning of the
bucket index that the single scan code provides to the filtering code to
instead force it to always include scan results.

Change-Id: I65cd57b14abacec3f407991188c570601d05ac77
Fixes: 28794598
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/scanner/ScanScheduleUtilFilterTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
c7d77be3baa194e67f676594ae8f958156e27cbb 17-May-2016 Mukesh Agrawal <quiche@google.com> Merge "packet fate: include status code for auth+associate" into nyc-dev
b32b649c815b0b50fd0127d9d4a4563c54a536fb 16-May-2016 Randy Pan <zpan@google.com> WifiConnectivityManagerTest: exponential backoff periodic scan

Add a couple of unit tests to cover the periodic scan exponential
backoff feature.

Extended MockAlarmManager class such that users can query a
pending alarm's trigger time.

Bug: 28750989
Change-Id: I9520477180786fce2937e5fa87f790f60f12a3da
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
5e550bdccf8aaace892366fbbaf90bd0a7c456af 14-May-2016 mukesh agrawal <quiche@google.com> packet fate: include status code for auth+associate

During 802.11 authentication, we've seen wpa_supplicant
report error information that is at odds with
over-the-air traffic.

For systems that provide packet fate for these early
frames, we can gather better information about the
auth process from the frames themselves.

Specifically: we can include the status code in the
packet fate summary. Make it so.

While there:
- fix a whitespace issue in parseIeee80211FrameCtrlType()
- rename frameControlField, since it didn't really hold
all of the frame control info. (frameControlField
omitted the frame control flags.)
- modify some packet fate tests to be less specific about
expected whitespace; it's too hard to maintain the tests
when exact whitespace matching is required

BUG=28717266
TEST=unit tests
TEST=manual

Manual test
- configure hostapd to allow zero connections
- configure bullhead to connect to hostapd
$ adb shell dumpsys > /tmp/dumpsys
- verify that packet fate summary shows auth frame with status 17

Change-Id: Ib8742091d0a9acc7fdde0423229d150bf4c1c6d8
rc/com/android/server/wifi/WifiNativeTest.java
rc/com/android/server/wifi/util/FrameParserTest.java
c2c27ff4aa6dfd4449612d61afd62d89b9652618 10-May-2016 Rebecca Silberstein <silberst@google.com> Merge changes Ie19e66b9,Idfcc51e2,Ie2b6f031 into nyc-dev

* changes:
WifiController: set to proper state after SoftAP
WifiControllerTest: cleanup style issues
WifiSettingsStore: add methods for WifiSavedState
51a0661e2f4554eb0103046d1ddc95afb158ad88 10-May-2016 Ningyuan Wang <nywang@google.com> Fix WifiApConfigStoreTests

Now that writeApConfiguration has no return type, so we
should also ignore the value in the tests.

BUG=28692504
TEST=compile
TEST=runtest frameworks-wifi

Change-Id: Ia4a562335de2c1dcadb5f41dcb3dc9f96a926680
rc/com/android/server/wifi/WifiApConfigStoreTest.java
191fa5b445e8cfd0fa2c4aa7458776ab7a3972f7 09-May-2016 Rebecca Silberstein <silberst@google.com> WifiController: set to proper state after SoftAP

After receiving a CMD_AP_STOPPED message, WifiController should return
to the DeviceActive state or the appropriate Idle state. This CL sets
the correct pending state and also adds a check for the idle state.
A test is also added to confirm the DeviceActive state is entered after
the SoftAp state is completed.

Note: An additional test for the DeviceIdle path will be added at a
later point after some code refactoring (bug 28669096)

BUG: 28434530
Change-Id: Ie19e66b9c84ff545a622119890bc7705ebd74c46
rc/com/android/server/wifi/WifiControllerTest.java
8ec7811cb6db1d605ed95060f3f792f2221cee88 07-May-2016 Rebecca Silberstein <silberst@google.com> WifiControllerTest: cleanup style issues

Clean up some style issues for WifiControllerTest.

This is in preparation for additional tests being added for the bug fix.

BUG: 28434530
Change-Id: Idfcc51e2d30753051b9d8e2ec066035f771f0339
rc/com/android/server/wifi/WifiControllerTest.java
b53cd9aa2625ec2a1c2e69c609d8a9dda3569a36 10-May-2016 Mitchell Wills <mwills@google.com> Merge "SupplicantScanner: Truncate hidden network list" into nyc-dev
362fad8eddd674d7cf19ffcc1fec38d2d2ee2f53 06-May-2016 Roshan Pius <rpius@google.com> SupplicantScanner: Truncate hidden network list

Truncate the hidden network id list if it goes beyond wpa_supplicant's
max value. wpa_supplicant has a hard coded value of 16 for the max
number of networks that can be specified for each scan.

There is currently no way to query this value from wpa_supplicant, so
hardcoding this value in SupplicantScanner.

BUG: 28632556
Change-Id: I31a338b91c221c1686437b738894e13abb897474
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/scanner/BaseWifiScannerImplTest.java
a4da0a81a0a93faac3a8d9ef8d83b1a35c500073 06-May-2016 Roshan Pius <rpius@google.com> Merge changes I1424053c,I96e35e06 into nyc-dev

* changes:
WifiConnectivityManager: Unit tests for metrics
WifiConnectivityManager: Increment metrics
1d7d62393181cc36b6f87c3cf2151adc54275f9c 04-May-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Unit tests for metrics

Add couple of unit-tests for metrics. Had to migrate the unit-tests to use
mock alarm manager.

BUG: 27479439
BUG: 27704599
BUG: 28480516
Change-Id: I1424053c35799905612b37edeb679e7556568ca5
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
855b32875a1ab89aa073f772790bdf71a42d08f9 04-May-2016 Mukesh Agrawal <quiche@google.com> Merge changes Icaa91d9d,Ic930337a into nyc-dev

* changes:
WifiStateMachine: dynamically configure WifiHAL log level
wifi service: abstract away access to SystemProperties
59298c7cfffdf856e32879ec967fe27c7e977a49 04-May-2016 Mitchell Wills <mwills@google.com> Add more details about what scan results were delivered to clients

Fixes: 28563549
Change-Id: I445054af4b176c69a26af6fe340a6eb88cf06452
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
f74a1cfd50d7b44aa7e4b598eb229cd464983dfe 03-May-2016 mukesh agrawal <quiche@google.com> wifi service: abstract away access to SystemProperties

We want the ability to modify the value of a system property,
so that we can dynamically change the logging level for WifiHAL.

This ability depends on permissions that are not available to
the test runner. For example, the process that is running the
wifi service code needs the ability to connect to the
|property_service| socket.

To resolve the problem, we do the following:
- add a PropertyService interface, which abstracts away access
to SystemProperties
- add PropertyService to the dependencies managed by WifiInjector
- add SystemPropertyService, which routes property requests
to android.os.SystemProperties
- update WifiStateMachine, to access properties via PropertyService
- update WifiStateMachineTest, to use a mock implementation of
PropertyService

BUG=27857554
TEST=unit tests

Change-Id: Ic930337a6a8f6a600ae7b4da2ca2eaf5c9e6c2cb
rc/com/android/server/wifi/WifiStateMachineTest.java
00f5ad8bafa58232b799e5195783a444fa9168fe 02-May-2016 Randy Pan <zpan@google.com> Merge "WifiConnectivityManager: PNO retry for low RSSI network" into nyc-dev
12cf770141cd8223809fbb69223dafb631ca4352 02-May-2016 Randy Pan <zpan@google.com> Merge "Fix check on current connected/connecting network" into nyc-dev
3d09b9117df33608a43c1fbe0135123e2de9aea2 27-Apr-2016 Randy Pan <zpan@google.com> WifiConnectivityManager: PNO retry for low RSSI network

Added an exponential back off retry mechanism for networks
found by PNO scan but rejected by QNS due to their low RSSI
values.

Bug: 28402107
Change-Id: I8a69afb3d22fbd2f479073e6087893c24e5a5d39
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
91a8893f047b8a193e4516ab772b6f43882777f5 30-Apr-2016 Rebecca Silberstein <silberst@google.com> WifiLastResortWatchdog: update config if not null

When new scan results are processed, networks already stored as the
available networks may have updated configs passed in, but they may also
have null configs. The null configs should not be used to update the
stored config. Added a check to determine if the passed in config is
not null before the update.

In addition, debugging output also reported the value of
HasEverConnected as false for networks with a null config. This was
updated to report null_config instead.

Added tests covering config updates.
Added tests for debugging output.

BUG: 28451079
Change-Id: Iff9888ab87c61619b2f865516eca22d87eb4f4b8
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
50abba06efa7834b5309df561375e4a2e2df630d 29-Apr-2016 Randy Pan <zpan@google.com> Fix check on current connected/connecting network

Keep track of the network BSSID of the last connection attempt.
This BSSID is checked in case the phone is still in the process of
connecting to that network. mWifiInfo is checked for the currently
connected network. This is for the case that firmware performed
roaming automatically.

While there, addressed a checkstyle issue.

Bug: 28462151
Change-Id: Ia9316048e0549036de1c20bf1f3099cfcda9a75e
Test: WiFi unit tests
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
ddf3afe31f5e2174643e41943e9e9b881033981a 28-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "WifiLastResortWatchdog metrics" into nyc-dev
7883cf595742b2c9b1ccba223b45a5fcb6978ec9 27-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes I91ad6127,I416bfd0e into nyc-dev

* changes:
WifiLastResortWatchdog trigger logic
WifiLastResortWatchdog failure counting
5f001750a0ce82a8b3a47ac566117d4de27f3e23 22-Apr-2016 Glen Kuhne <kuh@google.com> WifiLastResortWatchdog metrics

Added logging of various metrics to the WifiLastResortWatchdog. These
metrics count the number of times the Watchdog triggers, and stats
counting the number of networks present at failure time for different
failure types.

BUG=27856474

Change-Id: If43836b1c33791fefb8000196b231c312161feef
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
rc/com/android/server/wifi/WifiMetricsTest.java
83f2b8087178705445e4d1618eaac832f9c633f4 20-Apr-2016 Glen Kuhne <kuh@google.com> WifiLastResortWatchdog trigger logic

Implemented trigger condition logic that is checked after a failure is
counted. The condition takes into account: failure counts, wifi
connected state, past connections to saved networks and whether the
watchdog has fired since the wifi environment changed.

Please note: This change only implements the logic for deciding when to
trigger, not the trigger itself.

BUG=27856709

Change-Id: I91ad6127a72ca24c72a5520348c4fff83f16b559
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
c8a21e495dfaa5c44e87fda330621a1ed6c8aace 26-Apr-2016 Randy Pan <zpan@google.com> WifiConnectivityManager: Run AlarmManager on WifiStateMachine thread

With WifiScanner also running on the WifiStateMachine thread,
WifiConnectivityManager is now exectued on a single thread context.

While there, fixed a few checkstyle issues.

Bug: 28369823
Change-Id: Ibf2b65be42d243deb61a68380a9011f4acc663b4
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
8fe3e3497daf08b71ffc8c33cb7b139df6667448 14-Apr-2016 Glen Kuhne <kuh@google.com> WifiLastResortWatchdog failure counting

Implemented watchdog methods and calls to them from WifiStateMachine to
count association rejection, authentication failure & dhcp failures.

This will allow the watchdog to determine when all available networks
are failing, and Wifi Framework has no other options, however this Cl
does not implement that logic.

BUG=27855690
BUG=27856523

Change-Id: I416bfd0e0340823de5ca04f2d040bff7a751b677
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
9a65085cf054575bdb7fbd6bce672bd902b633fc 26-Apr-2016 Ningyuan Wang <nywang@google.com> Merge "Do not use ANQP when Wifi is connecting or connected" into nyc-dev
c7c241f0e59329c7c50101926fb9bde7ef6cca6f 26-Apr-2016 Mitchell Wills <mwills@google.com> Merge "Fix another potential crash when dumping WifiScanningService" into nyc-dev
1e5f0667515826cdc9c85a63a82c4c48cad446c2 22-Apr-2016 Ningyuan Wang <nywang@google.com> Do not use ANQP when Wifi is connecting or connected

Sending ANQP request when wifi is connecting or connected
may fail the connection.
This CL fixes it by adding a parameter to WifiConfigManager
::updateSavedNetworkWithNewScanDetail(). This boolean value
can indicate that we are connecting or connected.
Link debouncing is also considered as connecting in this case.

BUG=26494190
TEST=runtest frameworks-wifi
Change-Id: Ic4dfd0c0ba0392da68b6705d18fb82d92f44e508
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
d36b93b07ee7a3f6116cc7ae7a1a1e6b687a9d3c 25-Apr-2016 Mitchell Wills <mwills@google.com> Fix another potential crash when dumping WifiScanningService

Also make logging in WifiScanningService not static and add some tests
to verify some logging behavior.

Fixes: 28274869
Change-Id: I879200778dcadb4e67d5a85d42442baf3ceef6c9
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
c7338605251ff62f6e21737b1cfca865ce6f3dd9 22-Apr-2016 Roshan Pius <rpius@google.com> Merge changes I2bfae3a9,I3e247667 into nyc-dev

* changes:
WifiConnectivityManager: Unit tests for rate limit
WifiConnectivityManager: Connection rate limit
fa2ac2743307559e8dcc5aaf54873536315fbe62 19-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Unit tests for rate limit

Adding unit tests to verify the connection attempt rate limiting
functionality. Had to change the way system time is being fetched in
WifiConnectivityManager to achieve this.

BUG: 28242396
Change-Id: I2bfae3a9ea60cba1c3c1405dd5eb58208f12c2db
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
0b775f08887d4d52e57a06c6a8680aa10a1c7bb8 21-Apr-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "WifiLogger: fix bug in HAL callback registration" into nyc-dev
956fd40b6145c4aba9160e10bfc1ea609873ce8d 20-Apr-2016 mukesh agrawal <quiche@google.com> WifiLogger: fix bug in HAL callback registration

When we call WifiLogger.startLogging(), WifiLogger
may or may not register callbacks for ring-buffer
data delivery, and WiFi alerts.

Whether or not WifiLogger registers the callbacks
depends on whether or not the callbacks have already
been reigstered. If WifiLogger has already registered
callbacks, then a new call to startLogging() will
skip callback registration.

Now, it's not entirely clear if this already-registered
check is necessary. It is certainly conceivable that the
HAL implementations allow us to replace existing callbacks,
without explicitly removing the existing callbacks first.

But, the necessity of the check aside, the immediate
problem is that the already-registered check fails to
handle the case where an early registration failed.

This CL revises the code, to handle this case.

While there:
- Fix some whitespace issues.
- Remove unnecessary comment about the effects of
resetLogHandler(). (Even if the comment _were_ necessary,
it should be part of the Javadoc for resetLogHandler().)

BUG=28274991
TEST=(new) unit tests, manual

Manual test:
- boot device
$ adb shell dumpsys | grep -A1 'ring-buffer = driver_prints_rb'
ring-buffer = driver_prints_rb
<base64 encoded data...>

Change-Id: I04e9bc1863aaf5bda00ca9cf8dc35696ae1e5f24
rc/com/android/server/wifi/WifiLoggerTest.java
de68b305e798943904671f1dd56413b51fc479cb 20-Apr-2016 Jeremy Joslin <jjoslin@google.com> Merge "Use external scores on saved networks if requested." into nyc-dev
af8c59a9cb6b9cd0151b3cfa5d4ea2c698fd7eda 20-Apr-2016 Samuel Tan <samueltan@google.com> Merge changes Id4cc9c3c,Ice7dad5a into nyc-dev

* changes:
Log summarized packet fate reports
Add FrameParser
ea2048738be95ae9d5367a42ba798503a7039a6b 15-Apr-2016 Jeremy Joslin <jjoslin@google.com> Use external scores on saved networks if requested.

When a saved network has the useExternalScores boolean set to true then
lump it in with the ephemeral networks when considering it as a
candidate.

Externally scored saved networks are only considered if a saved network
candidate cannot be found.

BUG: 25562019
Change-Id: Icdb7318103e14e518536c3179cd30c87cc2c3035
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
6263b69c26fb5f03b6c995c8da81c9d69c2afe34 19-Apr-2016 Daniel Erat <derat@google.com> Merge "Refactor SoftApManagerTest." into nyc-dev
c91804e4bbf96cdabacc48ab5db72958f63930e7 19-Apr-2016 Robert Greenwalt <rgreenwalt@google.com> Merge "Fix unit test to check both ECM configs" into nyc-dev
590f3fc2045389d5ef274c4b3bd6162d93b1a0ac 13-Apr-2016 Samuel Tan <samueltan@google.com> Log summarized packet fate reports

When verbose debugging is not turned on, log
summarized packet fate reports that include the
timestamp, direction, fate, protocol, and type of the
network frame, but nothing more. These one-line
summaries will be logged to the system dump in
table format.

BUG: 28150622
TEST: 'runtest frameworks-wifi' passes.
TEST: Manually trigger a WiFi connection failure (e.g. enter
wrong password for a secured network), and examine the
output of 'adb shell dumpsys' for the logged packet fate
summaries.

Change-Id: Id4cc9c3cdc85d209788e0eb1c51e5a47e04d0a6a
rc/com/android/server/wifi/WifiLoggerTest.java
rc/com/android/server/wifi/WifiNativeTest.java
2225e1eb8c27a2f0c8bb650d248cd2e041517941 18-Apr-2016 Robert Greenwalt <rgreenwalt@google.com> Fix unit test to check both ECM configs

We added a carrier config that dictates how ECM affects WiFi.
Only old devices (before WiFi-calling) on VZW should turn off
WiFi when in ECM/ECBM. Try both configs.

bug:28244943
Change-Id: I4047565c00989b9bf02479c89b06041b7171cf44
rc/com/android/server/wifi/WifiControllerTest.java
a6b66a48b231f5729b8015d3446feb4c2fa0a9d1 06-Apr-2016 Roshan Pius <rpius@google.com> QNS: Skip ephemeral networks deleted by user

Skip ephemeral networks which were explicitly deleted by the user. This
was missed in migration from autojoin to QNS.

BUG: 28026676
Change-Id: Ib663183b29774b851e492ddd170c4b4bef03ae61
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
be40e20f6995d9d11c8270502120a07785dde270 12-Apr-2016 Daniel Erat <derat@google.com> Refactor SoftApManagerTest.

SoftApManagerTest formerly had tests that doubled as helper
methods (sometimes even calling each other), making it
difficult to simulate events occurring in different orders.

This change creates a clearer distinction between helpers
and tests, and also tries to classify helpers as either
starting processes or verifying that the code under test did
what was expected.

Bug: 28107595
Change-Id: I743d8abbf73ffcd6988ef16d00286733355582ea
rc/com/android/server/wifi/SoftApManagerTest.java
70b4f7f1b8f57c5ae449dedb48edc0d07b6b5c41 14-Apr-2016 Samuel Tan <samueltan@google.com> Add FrameParser

Add FrameParser, a utility class that parses the contents
of a network frame, and stores it in its public member fields.
This utility will be used to print out summarized versions of
the contents of packet fate report frames.

In this initial implementation of FrameParser, we only parse out
the information we are interested in printing (i.e. the most specific
networking protocol, and the type of packet within this protocol).

BUG: 28150622
Change-Id: Ice7dad5a7800736605043688955027893fadffc7
TEST: 'runtest frameworks-wifi -c \
com.android.server.wifi.util.FrameParserTest' passes.
rc/com/android/server/wifi/util/FrameParserTest.java
6095c3ef2eb6dbe7321a23b146997ad13875696d 15-Apr-2016 Mitchell Wills <mwills@google.com> Merge "Run WifiScanner on WifiStateMachine thread" into nyc-dev
33e62df1fd2d065f6d626d800350e2063978a0ab 15-Apr-2016 Glen Kuhne <kuh@google.com> Merge "Created LastResortWatchdog class" into nyc-dev
5ccc0a429dfea8ef452f8f63454b013983eb87fe 07-Apr-2016 Mitchell Wills <mwills@google.com> Run WifiScanner on WifiStateMachine thread

Fixes: 27695292
Change-Id: I34f05fc532c48c7c3eaa735bc6ec95e7da2794aa
rc/android/net/wifi/WifiScannerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
09abbe29be6e552a2531b0367bd6d29647d33767 30-Mar-2016 Glen Kuhne <kuh@google.com> Created LastResortWatchdog class

Created the WifiLastResortWatchdog class, that will handle restarting
the wifi stack as a last resort when wifi is failing.
Implemented the logic that tracks failure counts for all available
networks, and the maintaining of that list of available networks.

BUG=27856523

Change-Id: I8c944d033955ad7e5cc9484cce8f20cd3755312e
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
rc/com/android/server/wifi/WifiLastResortWatchdogTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
c38419bd95b0934cb1dfc6f1e1f29eca9929da8c 14-Apr-2016 Rebecca Silberstein <silberst@google.com> Merge "Update hasEverConnected for wifi networks" into nyc-dev
deaf58e6f2c5fb93543f3ead79c1f160cc2248a8 14-Apr-2016 Roshan Pius <rpius@google.com> Merge "BackgroundScanScheduler: Optimize buckets" into nyc-dev
2b7a4daa21df85f6a8ca2c4992ba53634071cac6 14-Apr-2016 Mukesh Agrawal <quiche@google.com> Merge changes I8da6c1a4,I619b9c81,I22a753d7,If818bc37 into nyc-dev

* changes:
wifi service: nuke verbose logs on no-verbose
wifi service: add support for driver dump HAL API
WifiLogger: make firmware dump conditional on verbose
wifi service: add utility to check printability
216eb45e7fb44a1ba8edc156d08b532a17219f66 08-Apr-2016 Roshan Pius <rpius@google.com> BackgroundScanScheduler: Optimize buckets

Optimize the buckets to ensure that the same channel is not scheduled
across multiple buckets. The settings are split if some of the channels
in the setting is already being scanned in lower time period bucket.
Also go thru each bucket and check if any of them don't fit into the
bucket specifications, if yes create split buckets with the same
time period. The split buckets will cumulatively contain all the channels
needed to be scanned in the original buckets.

BUG:28022609
Change-Id: Ie24bc3ec891965adad0ce6e855015be6ff5f0740
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java
6e1539d01b5c05f790d803b98128f2a03b7e155f 13-Apr-2016 Glen Kuhne <kuh@google.com> Merge "WifiMetrics Extension" into nyc-dev
ce003b812aead64dcb36647180991150021b24c1 12-Apr-2016 Glen Kuhne <kuh@google.com> WifiMetrics Extension

Extended the wifi metrics proto with the changes submitted
logs/proto/wireless/android/play/playlog/connectivity/wifi.proto in
CL/119321981.
Added interfaces to WifiMetrics for incrementing the Connectivity
Watchdog counts.

The new Connectivity Watchdog metrics can be viewed in the 'WifiMetrics'
section output by:
adb shell dumpsys wifi

BUG=27479439

Change-Id: I38f0a0ad7c7e0b4d3f0054c818d188ac1b171121
rc/com/android/server/wifi/WifiMetricsTest.java
2ecb62764d26c3f0d95a9dc5c0a616af1b2bf8de 12-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: nuke verbose logs on no-verbose

When a user disables verbose Wi-Fi logging, they
probably don't want to retain firmware dumps or
driver dumps. Similarly for packet fate logs (at
least in raw form).

Nuke such data on entering non-verbose mode,
accordingly.

While there: update reportConnectionFailure(),
to use the recently added isVerboseLoggingEnabled()
method.

BUG=27554392
BUG=27528124
TEST=unit tests

Change-Id: I8da6c1a4ab11e5f43b9e660fb64efed62e7cb9e3
rc/com/android/server/wifi/WifiLoggerTest.java
d0cb2fae195ebb9f658095667f3c7b7b8d69a204 07-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: add support for driver dump HAL API

Implement the framework side of the driver dump HAL API:
- When a bugreport is generated, ask the HAL to provide
a driver memory dump.
- When dumping a bugreport, include the driver memory
dump (if available).

Along the way: add a stub implementation of the driver
dump HAL API, in case a particular vendor HAL does not
implement the API.

While there: declare the (existing) callback for
firmware memory dumps as static. There's no need for
on_firmware_memory_dump() to be visible outside of
com_android_server_wifi_WifiNative.cpp. (Modules
that need access to on_firmware_memory_dump() will be
provided with a pointer; they don't need to reference
the function by name.)

BUG=27554392
TEST=unit tests
TEST=bullhead: dumpsys + verify that driver dump is present
TEST=angler: dumpsys + verify we properly handle unimplemented API

Change-Id: I619b9c819a41a795c1119a8c2fa22447f0c44b56
rc/com/android/server/wifi/WifiLoggerTest.java
rc/com/android/server/wifi/WifiNativeTest.java
e31290e1c2eebf70c5ab22091a9520c7a001161e 12-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: add utility to check printability

When logging data, it's useful to know whether or not
the data is plain ASCII. (If so, we can print the
data raw. Otherwise, we need to base64 encode the data.)

To meet this need: add a utility method to check if a byte
buffer contains (only) printable ASCII.

BUG=27554392
TEST=unit tests

Change-Id: If818bc378c6f146e7517f6ae4bb36b4b5bb8db48
rc/com/android/server/wifi/util/StringUtilTest.java
604285d676078e9d0d5c7944770bdba36144363e 13-Apr-2016 Wei Wang <weiwa@google.com> Merge "Send failure reason from RttService." into nyc-dev
93332917bf29ddbe853a495816e486150f49da40 29-Mar-2016 Rebecca Silberstein <silberst@google.com> Update hasEverConnected for wifi networks

Set hasEverConnected to true for a network that completes a connection.

Set hasEverConnected to false when a network config changes.

Add tests to confirm hasEverConnected was added on a successful
connection and cleared when connection or credential related
configuration changes are made.

Also removed some unused imports to fix checkstyle issues in
WifiStateMachine and WifiConfigStore.

BUG: 27856374

Change-Id: Ica633166892b4673683f21ff98e3ded1607dedec
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
49db6a0f9104fea99013fa6cfe6fcf2bdc7aa661 12-Apr-2016 Rebecca Silberstein <silberst@google.com> Merge "WifiConfigStore: read requirePMF config variable" into nyc-dev
87a0e55e7d75e305e0fb50a0748d2002cd44c984 12-Apr-2016 Wei Wang <weiwa@google.com> Send failure reason from RttService.

Also use CMD_OP_ENALBE_RESPONDER_FAILED when wifi is not available.

Bug: 28143916

Change-Id: I8eb6139e3464989739783fd96637d549756aa2cf
rc/com/android/server/wifi/RttServiceTest.java
eaea4b75c2ecfd192d5dcefcf67bb851bf031f5e 12-Apr-2016 Rebecca Silberstein <silberst@google.com> WifiConfigStore: read requirePMF config variable

When saving a wifi configuration, we set the requirePMF variable from
the config, but it is never read back.

Add the getNetworkVariable call for pmfVarName and add a call to verify
the attempt to read it back in the WifiConfigManagerTest.

Additionally fixed a checkstyle issue for unused imports.

BUG: 28088226
Change-Id: Ib7b2ba796e31ae57273c34b6845c218419125b72
rc/com/android/server/wifi/WifiConfigManagerTest.java
7429ca2593265cc1b97fb0d616ef3c07364b2931 12-Apr-2016 Samuel Tan <samueltan@google.com> Merge "Rename WifiConfigManager.getConfiguredNetworks()" into nyc-dev
b0af0c308d20860dc90727eff1c76e0445d20c96 12-Apr-2016 Mitchell Wills <mwills@google.com> Merge "Move WifiScanner related code to scanner package" into nyc-dev
7f8d45b1a56d7c6f2702aabb84e0eba597b525b0 12-Apr-2016 Sebastien Hertz <shertz@google.com> Merge "Update code coverage filter" into nyc-dev
a8367288377cbaed6371256ca837b7aa22280706 11-Apr-2016 Mitchell Wills <mwills@google.com> Move WifiScanner related code to scanner package

Change-Id: I73d01fe4d0de99a4e9758353cacf1d7a790cf040
rc/android/net/wifi/WifiScannerTest.java
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/MockResources.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiScannerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/scanner/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/scanner/HalWifiScannerTest.java
rc/com/android/server/wifi/scanner/SupplicantPnoScannerTest.java
rc/com/android/server/wifi/scanner/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/scanner/WifiScanningServiceTest.java
60969bf2c849011fb585cf6dc914dbd779dfb8cf 11-Apr-2016 Samuel Tan <samueltan@google.com> Rename WifiConfigManager.getConfiguredNetworks()

Rename WifiConfigManager.getConfiguredNetworks() and related methods
to WifiConfigManager.getSavedNetworks, since it better reflects
what this method does (i.e. get all configured networks except
ephemeral networks). While there, add comments for some previously
undocumented helper methods.

BUG: 28088229
Change-Id: I30e144b46277605f5847371d9e65b70306013cf5
TEST: 'runtest frameworks-wifi' passes.
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
492900e5895d4480292d5f7518d109e6b3b9fb47 11-Apr-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiStateMachine: reduce number of LogRecords" into nyc-dev
05fca10c16c990e610c627f11dabb7552075ba05 11-Apr-2016 Sebastien Hertz <shertz@google.com> Update code coverage filter

Use specific coverage filters variables instead of LOCAL_JACK_FLAGS
so filters are only passed to Jack when code coverage is enabled.

Bug: 28014424
Change-Id: I300855169a6295b2e59fcfea63c8f366529fdc24
ndroid.mk
cf2c37cff48a96fe221121dfe6a0360a54ed9ebb 06-Apr-2016 mukesh agrawal <quiche@google.com> WifiStateMachine: reduce number of LogRecords

Allowing 3000 LogRecords uses too much memory (we've
seen >1 MB in some cases). Lower this limit to 100
records, as it was before.

To facilitate debugging issues that happen overnight,
allow the user to opt-in to a larger log record buffer.
To do so, the user should "enable wi-fi verbose logging"
under developer options.

BUG=27504679
TEST=unit tests

Change-Id: Iee983e3c815bef1a9e05f7085147bc73c79753f6
rc/com/android/server/wifi/WifiStateMachineTest.java
a88d1b207c401c4510e635156442973a8e30ac95 11-Apr-2016 Samuel Tan <samueltan@google.com> Merge changes I468f7425,I649dca1b,Ic7f97157,I06a8be88 into nyc-dev

* changes:
WifiConfigManager: remove WifiStateMachine field
Move wnmFrameReceived() from WifiConfigManager to WifiStateMachine
Move mActiveScanDetail from WifiStateMachine to WifiConfigManager
Remove getCurrentUserId() and getCurrentUserProfiles() from ...WifiStateMachine
e78a18cf874b4d9bb5db2ef7804b8ac576e56489 09-Apr-2016 Mitchell Wills <mwills@google.com> Fix unit tests after rebase of scan worksource CL

Fixes: 28096237
Change-Id: I1f9d9284f3b2a09892d2d1d1ff4a3faccb54d616
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
f1c2e8cc3728f65aee24905ad5c44e84891f0693 08-Apr-2016 Glen Kuhne <kuh@google.com> Merge "Added buffering of filtered ScanDetails to QNS" into nyc-dev
c3086fbd364c81933a0d4401c962ab5f4519adc6 08-Apr-2016 Etan Cohen <etancohen@google.com> Merge "Update mock AlarmManager to handle setExact method." into nyc-dev
1a572a27cffc6ee853f9b6a40d83eef18963e2b0 08-Apr-2016 Randy Pan <zpan@google.com> Merge "Build ESS into the GScan result's Capabilities" into nyc-dev
0efd09fea566f4445807b6aff60b18e127e72d38 31-Mar-2016 Glen Kuhne <kuh@google.com> Added buffering of filtered ScanDetails to QNS

Added logic to buffer the scanDetails considered by
QualifiedNetworkSelection as potential candidates (has a saved config,
and signal strength over threshold). And a getter to access these.

BUG=27932650

Change-Id: I4e04194c944f7d8a18719d7dfc7b66cbf42eb5af
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
11d58263dc941e2ec644ea89de83725d3e1256e1 08-Apr-2016 Etan Cohen <etancohen@google.com> Update mock AlarmManager to handle setExact method.

Required in order to correctly handle testing with WakeupMessage.

(cherry-pick of 2bcc7eb8b06fe2da4853e0c350bc10e2689440dc)

Change-Id: I1cd4d4841da0b9af8dfe9a3ad47c173516ef5162
rc/com/android/server/wifi/MockAlarmManager.java
ac69b83c9cafb9a839b578c3b5b71eb3439244ad 08-Apr-2016 Samuel Tan <samueltan@google.com> WifiConfigManager: remove WifiStateMachine field

Remove the WifiStateMachine field from WifiConfigManager, since the
latter no longer calls methods of the former. Also, change calls
to the WifiConfigManager constructors to accomodate this change.

BUG: 27405059
Change-Id: I468f74259d45d9a1a61e00b987533eaa66846024
TEST: 'runtest frameworks-wifi' succeeds.
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
94e8f71b884e11abb8c46e69467af96f17d6423e 08-Apr-2016 Mukesh Agrawal <quiche@google.com> Merge changes from topic 'ring-buffer-size' into nyc-dev

* changes:
wifi service: use large ringbuffers in verbose mode
ByteArrayRingBuffer: add ability to resize buffer
06636d2de935ad5d2e8fb6483c406fe922c75ff2 05-Apr-2016 Samuel Tan <samueltan@google.com> Remove getCurrentUserId() and getCurrentUserProfiles() from
...WifiStateMachine

Move getCurrentUserId() from WifiStateMachine to WifiConfigManager,
and remove WifiStateMachine.getCurrentUserProfiles(), so that
WifiConfigManager no longer makes calls to WifiStateMachine to
perform these two tasks.

Achieve this by moving the bookkeeping for the current user ID
from WifiStateMachine to WifiConfigManager.

BUG: 27405059
Change-Id: I06a8be88f24fd81cbfe785c4304883ddc44658f8
TEST: 'runtest frameworks-wifi' succeeds.
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
73a52d3336a40903965b946f6d3624a223ad5aac 07-Apr-2016 Samuel Tan <samueltan@google.com> WifiConfigManager: rename member and constant fields

Rename fields in WifiConfigManager to properly reflect that
they are members (m* prefix), and constants (all caps with
underscores). To accomodate this change, also modify uses
of these fields outside WifiConfigManager (e.g. in WifiStateMachine).

Also:
- Remove default values given to WifiConfigManager member fields
that are initialized in its constructor, since the initalization renders
the default values useless.
- Remove member fields and constants that are unused.
- Replace the "*Milli" suffix on fields with "Ms".
- Re-ordered fields in a logical manner (i.e. static, public, then
private).
- Fixed checkstyle issues.

BUG: 27300099
Change-Id: Ifaef76bc04960f12f09267a581b9a02da7c5ab5c
TEST: 'runtest frameworks-wifi' passes.
TEST: Checkstyle returns only missing javadoc errors.
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
d604bbd63d620244ef43408de10f65ead01d5026 06-Apr-2016 mukesh agrawal <quiche@google.com> wifi service: use large ringbuffers in verbose mode

When the user has chosen to enable wi-fi verbose
logging, we'd like to use larger ring buffers.

Make it so.

BUG=27578082
TEST=unit tests

Change-Id: I1e2447df2beda455cea37072e91fa0aac338bb3f
rc/com/android/server/wifi/WifiLoggerTest.java
ca0bac5826ab430d1b765b201a609f7bc38401ee 06-Apr-2016 mukesh agrawal <quiche@google.com> ByteArrayRingBuffer: add ability to resize buffer

When verbose mode is enabled, we'd like to use
larger ring buffers. To support this, add the
ability to resize a ByteArrayRingBuffer.

BUG=27578082
TEST=unit tests

Change-Id: I976a2ec05ade3f5c2c0fe5dc50cbb391534ab241
rc/com/android/server/wifi/ByteArrayRingBufferTest.java
9b5773d2805e8c6141ca75de272921a84941546b 07-Apr-2016 Randy Pan <zpan@google.com> Build ESS into the GScan result's Capabilities

Obtain this piece of information from the beacon and build it
into the Capabilities string.

Bug: 27810218
Change-Id: Iffa57f6e1c0997e5705da779a3693de9e3108e37
rc/com/android/server/wifi/util/InformationElementUtilTest.java
1d540dbd9ddeafc27dda51e26b0303df4a66914d 07-Apr-2016 Roshan Pius <rpius@google.com> Merge "WifiNative: Remove PnoMonitor" into nyc-dev
8ba794562167643688ee38352f98345403fa22c8 07-Apr-2016 Roshan Pius <rpius@google.com> WifiNative: Remove PnoMonitor

Remove PNOMonitor from WifiNative since it has been refactored out into
SupplicantScanner now.

BUG: 27677054
Change-Id: I99850a1e59bfe0ee21c674467ae7480df85e76ff
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
7284b9d30f671657dee2f232e01dad46259764b2 07-Apr-2016 Junda Liu <junda@google.com> Merge "Update WifiStateMachineTest to new sim authentication API." into nyc-dev
d6d22df90639c55a15aa6f1b4c5516269689376a 06-Apr-2016 Junda Liu <junda@google.com> Update WifiStateMachineTest to new sim authentication API.

Old getIccSimChallengeResponse has been deprecated. So the mock is updated
to the new getIccAuthentication API.

Bug: b/28021965
Change-Id: I03098b614ae74b8d91527a78c004d3c7fd0e3760
rc/com/android/server/wifi/WifiStateMachineTest.java
2a9dc4d883484e006054433426be91c6e675754c 07-Apr-2016 Randy Pan <zpan@google.com> Merge "Wifi Connectivity Manager" into nyc-dev
84d962ec8f487f824214744498bba505a6db0c59 11-Feb-2016 Randy Pan <zpan@google.com> Wifi Connectivity Manager

Created a submodule which manages all the WiFi connectivity
related operations. It starts a scan when screen turns on/off,
WiFI gets connected/disconnected or on demand. The scan results
are passed to QNS for it to recommend a network to connect to.

Clean up the relevant logic from WifiStateMachine.

Bug: 26666366
Bug: 27227489
Bug: 27677391
Bug: 27364917
Change-Id: I65405506ff55940d0b23f1407e476bff6fce47fa
rc/com/android/server/wifi/WifiConnectivityManagerTest.java
d1bd53369b88d91968c19dd0cc288d1d2db8b3c6 06-Apr-2016 Mukesh Agrawal <quiche@google.com> Merge changes from topic 'packet-fate' into nyc-dev

* changes:
WifiStateMachine: report failures to WifiLogger
WifiLogger: add support for packet fate
WifiNative: flesh out packet fate implementation
WifiNative C++: add support for packet fate
WifiNative: add infrastructure for packet fates
jni_helper: add createObjectWithArgs
ed510cfa64decd813f76faf9bb1b0a70b74b9898 01-Apr-2016 mukesh agrawal <quiche@google.com> WifiLogger: add support for packet fate

1) Provide a method for other parts of wifi service
to report connection failures to WifiLogger.
2) Start packet fate monitoring if/when we start
logging in verbose mode.
3) Fetch packet fates on failure, as appropriate.
4) Include packet fate information in dumps.

While there:
a) Change visibility of the single-arg dump() method
in BaseWifiLogger. (Only derived classes should be
calling that overload.)
b) Disambiguate the call from WifiLogger.dump() to
BaseWifiLogger.dump(), by adding |super| to the
expression.
c) Remove unused WifiNative.WIFI_ERROR_UNINITIALIZED

BUG=27528124
TEST=unit tests

Change-Id: Ica85ce39e79983194c3930ef54c29ac07454faed
rc/com/android/server/wifi/WifiLoggerTest.java
0fcb06473cbe2824e401a80c0520bb1c14ed8f41 01-Apr-2016 mukesh agrawal <quiche@google.com> WifiNative: flesh out packet fate implementation

1) Add methods to invoke the packet fate HAL functions.
2) Add methods to dump a packet fate to a string.

BUG=27528124
TEST=unit tests

Change-Id: I3897687099ab19f5cf24a0821cbc6600ea12e52a
rc/com/android/server/wifi/WifiNativeTest.java
09b1d0786d05436d524d7556c269e665a0962ee6 01-Apr-2016 mukesh agrawal <quiche@google.com> WifiNative: add infrastructure for packet fates

1) Define the Java classes that the C++ code will
copy packet fate information into.
2) Define the constants that will be used to represent
fates. (This is needed to write readable tests for
item 1.)
3) Declare the native methods on the Java side.
(This is required for registerNatives to continue
to work, after we add the new methods on the C++
side.)

BUG=27528124
TEST=unit tests

Change-Id: If0930f645f95e60c8cb471b10fcb740273159e05
rc/com/android/server/wifi/WifiNativeTest.java
2fc3d4dcabb6ddcd72dc335d908aa192c38c5e5f 26-Mar-2016 Samuel Tan <samueltan@google.com> WifiConfigStore: use configKey instead of SSID as unique ID in
...readNetworkVariablesFromSupplicantFile

Use the configKey stored in the id_str field of wpa_supplicant.conf,
rather than SSID, to uniquely identify networks in
readNetworkVariablesFromSupplicantFile.

Also:
- Remove WifiConfigStore.readNetworkVariableFromSupplicantFile(),
and move the logic in that method into
WifiConfigManager.readNetworkVariableFromSupplicantFile().
- Add a helper method, WifiConfigStore.readNetworkVariablesFromReader(),
so that we can inject a test supplicant config file during testing.
- Add WifiConfigStoreTest.java, which currently only contains unit tests
for WifiConfigStore.readNetworkVariablesFromSupplicantFile().

BUG: 26733972
Change-Id: Ice2dcdae0c2e95b4df6459f75f3a98df30290256
TEST: 'runtest frameworks-wifi' succeeds.
rc/com/android/server/wifi/WifiConfigStoreTest.java
6df7fec4f26e87bbebc0d0857a3ac858e4b879e6 31-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Fix WifiStateMachineTests after adding WorkSource scan argument" into nyc-dev
74524b55c7aa23d79d0aa5513b5626209482aa8b 31-Mar-2016 Mitchell Wills <mwills@google.com> Fix WifiStateMachineTests after adding WorkSource scan argument

Fixes: 27942752
Change-Id: I6994dea18151060f568b1d5211d8049989eecb53
rc/com/android/server/wifi/WifiStateMachineTest.java
c343aec32e1d3fe320eb97c527b0bcfb2d334e45 29-Mar-2016 Roshan Pius <rpius@google.com> WifiScanningServiceImpl: Create PNO state machine

Adding a PNO state machine to fetch full scan results for all types of
PNO when reporting events back to the client.

BUG: 27886011
TEST: Compiles & unit-test passes
TEST: Made changes in WifiConnectivityManager to use the scan results to
auto-connect.
Change-Id: I18879cb1bf82226e329c6076e8443e0986ddbe27
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
0e776ddb6de62e76c54ff32148d9d170172be308 30-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Add handling of incoming WorkSource for scans" into nyc-dev
c71fb2904e5588444ff2cbab6273661921675339 30-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Use buckets scanned field when delivering scan results" into nyc-dev
0ea5062316013cd4173faf16c2a0f3ecd1b9ed43 30-Mar-2016 Mitchell Wills <mwills@google.com> Add handling of incoming WorkSource for scans

Bug: 27903217
Change-Id: Ic3693e083c3ac7369465bfd6cbd4dadebe03f907
rc/com/android/server/wifi/WifiScanningServiceTest.java
c4f23cbd6de85cbffcd91b398e51eff106ef08d4 26-Mar-2016 Mitchell Wills <mwills@google.com> Use buckets scanned field when delivering scan results

Fixes: 27506257
Change-Id: I224b78a89dfde54ef4f3dae37f1bb10d2a12b78e
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/scanner/ScanScheduleUtilFilterTest.java
e7ba2963bedf426a1d8ba09ab535260ef364512b 23-Mar-2016 Roshan Pius <rpius@google.com> SupplicantWifiScannerImpl: Add Pno Debouncer

Add the PNO debouncer class for PNO scan request debouncing. We debounce
all PNO scan/stop requests for 5 seconds. Pno pause bypasses this
debounce logic so that we can immediately schedule the
single/background scan after stopping the PNO scan.

BUG: 27677054
Change-Id: Ibafeb936e30c9c6c1b23a39d9ed08b23a5f72030
TEST: Compiles & unit test passes
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
ee97dbe41341f72eb8a56af2899f19f9ac823935 25-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Cleanup Wifi tests makefile" into nyc-dev
aa575d82dcc01cb213402923796c870ecdd45b28 25-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Pass buckets scanned from HAL to framework" into nyc-dev
b9cc92f3325f8bb08bf7eb1e1fd25d40cfe43604 25-Mar-2016 Glen Kuhne <kuh@google.com> Merge "Add scanning into WifiMetrics" into nyc-dev
c2c2648141e6190d85601ee8a6a1d0034e7ff927 11-Mar-2016 Glen Kuhne <kuh@google.com> Add scanning into WifiMetrics

Added calls to WifiMetrics to increment various scanning metrics, in the
Single & Background - ScanStateMachine's.
Added expected metrics value checks to existing unit tests.

BUG=25691077

Change-Id: I7c335d829876f6b31220571bb4330b7b30f4cc0e
rc/com/android/server/wifi/WifiMetricsTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
2977ce6833c307ce5a597c56060567da4707f8bb 22-Feb-2016 Mitchell Wills <mwills@google.com> Cleanup Wifi tests makefile

Cleanup the makefile so that it only specifies libraries once instead of
as both non-static and static deps if possible. Also add some comments
for some of the more confusing parts.

Change-Id: I1733a9685ad0582d01679e235e7a7181f5a6449a
ndroid.mk
cba3f6e3c7466c8cc76d5642c6f90970f42b314f 24-Mar-2016 Jeremy Joslin <jjoslin@google.com> Merge "Allow ephemeral WiFi conns to be marked as metered" into nyc-dev
3ab8ec5cfa986b07e1c948af0f45bd333edef24c 21-Mar-2016 Jeremy Joslin <jjoslin@google.com> Allow ephemeral WiFi conns to be marked as metered

Pass through the metered hint from the score cache to the
WifiStateMachine when making an ephemeral connection. The
NetworkPolicyManagerService already looks for the hint after
every NETWORK_STATE_CHANGED_ACTION and takes the correct action.

BUG: 27120794
Change-Id: I3d4a5030724e8e0fb1084c67d74fb768bd9ad2b5
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
3b479405c66fd65c2ac9d88dcdae936cf8477e3a 23-Mar-2016 Paul Stewart <pstew@google.com> Merge "WifiNotificationController: Take a looper" into nyc-dev
c9e6069eb941d282af213dc20b171877db6b567b 23-Mar-2016 Mitchell Wills <mwills@google.com> Pass buckets scanned from HAL to framework

Bug: 27506257
Change-Id: Ia57327e265317fd0d1ce09d238d9c1e9c55bf2b1
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
4e54617758f86acef751bc8588257a58ed985b0f 22-Mar-2016 Mitchell Wills <mwills@google.com> Move scan filtering to a common utility class

This way single scans don't depend on the background scan scheduler

Bug: 27506257
Change-Id: I7130302b364cc86e3a8f1cd0a168e0068c29953b
rc/com/android/server/wifi/scanner/BackgroundScanSchedulerFilterTest.java
rc/com/android/server/wifi/scanner/ScanScheduleUtilFilterTest.java
361c13b35fb024d87176e423619e3bfe8e6bdc38 23-Mar-2016 Ningyuan Wang <nywang@google.com> Merge "fix WifiNative unit test failure" into nyc-dev
adad2ba52d44119ad20efffb04ec0a70459e7113 23-Mar-2016 Roshan Pius <rpius@google.com> Merge changes Ia15900d4,I4e82007c into nyc-dev

* changes:
WifiScanningServiceImpl: Sw PNO scans
WifiScanningServiceImpl: Refactor background scans
40abf54c81c5624641543d86e1d7ab21ebe30175 08-Mar-2016 Paul Stewart <pstew@google.com> WifiNotificationController: Take a looper

This CL adds a Looper argument to the WifiNotificationController
constructor, so its Handler can be initialized with a specific
looper instead of relying on the default.

Bug: 27545448
Test: runtest frameworks-wifi \
-c 'com.android.server.wifi.WifiNotificationControllerTest' \
-m 'verifyNotificationDisplayed'

Change-Id: I33fb221ddfead0b24d98bd23c92c0226ff3c6a1d
rc/com/android/server/wifi/WifiNotificationControllerTest.java
754267d3fd20438d771570e923f6a219783dc50c 22-Mar-2016 Ningyuan Wang <nywang@google.com> fix WifiNative unit test failure

This fixes the WifiNative unit test failure by calling constructor
with correct parameters.

Bug: 27796813
TEST=compile, unittests

Change-Id: Ic22fee5fa28b7730018f09e234207e0e29e3ddaa
rc/com/android/server/wifi/WifiNativeTest.java
24fd5197092ef8a143edcb11dac3383483aa0650 22-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Make sure to cleanup when timing out from a single scan" into nyc-dev
6c5018cef1eb7acbcfa7fc6c9b7c018bab7ba7ba 18-Mar-2016 Roshan Pius <rpius@google.com> WifiScanningServiceImpl: Sw PNO scans

Moving the implementation of SW PNO scans from SupplicantScanner to
WifiScanningServiceImpl.

WifiScanningServiceImpl checks is HW PNO is supported by the
scanner implementation:
a) if false it manually schedules a background scan and
converts all background scan results to PNO results.
b) if true, it lets the scanner implementation handle the PNO scans.

BUG: 27742823
Change-Id: Ia15900d402ba005d11251931b39bf30b8d21a02c
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
9d0c558cab7c80a572a32ae70d501df15367fd5f 21-Mar-2016 Mitchell Wills <mwills@google.com> Make sure to cleanup when timing out from a single scan

Also fix general failure cases

Bug: 26095183
Change-Id: I88433ff77c0adb4073350ae7a4746b5ee4da5033
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
8f86598c612698b39cad15b4a0f03619d05fd7d6 21-Mar-2016 Paul Stewart <pstew@google.com> Ensure WifiEnterpriseConfig does not display passwords in toString

Add a unit test to ensure that passwords are not displayed in
WifiEnterpriseConfig.toString().

Bug: 25624963
Change-Id: I0a05dd8c4afbd4a8e7d7cbf0447e04328210ac48
rc/android/net/wifi/WifiEnterpriseConfigTest.java
b96a2696678dedf52bdaf97f41c7d8b76dfa561e 18-Mar-2016 Glen Kuhne <kuh@google.com> Merge "Remove SupplicantStateTracker dependency on WSM" into nyc-dev
54c9cf8d299b99f8b999bc2cf4adcda1eba81469 18-Mar-2016 Glen Kuhne <kuh@google.com> Remove SupplicantStateTracker dependency on WSM

Removed the SST's dependency on WifiStateMachine, since it doesn't use
it for anything.

BUG=27725788

Change-Id: I209056f8ecc9fe73d184718b86a0b8442e3950ea
rc/com/android/server/wifi/WifiStateMachineTest.java
dcd877d6c143db557884993ea437e2a432cb0ba3 17-Mar-2016 Roshan Pius <rpius@google.com> SupplicantScannerImpl: Support connected PNO scan

wpa_supplicant does not support PNO scans when it is in connected state.
So, we need to revert to using background scans for devices which do not
support ePNO.
So, connected PNO becomes a SW PNO scan regardless of whether the device
supports HW PNO scan or not.

BUG: 27525899
Change-Id: I84fb8f5028403dae00302940e9d71ca1c0603de3
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
71466f8b3cccbc46abad4f5b2d710fb22ce886cb 18-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Merge MultiClientScheduler and WifiScanningScheduler" into nyc-dev
95984d1af44a00183a4b0e0ed61417583096ff90 17-Mar-2016 Mitchell Wills <mwills@google.com> Merge MultiClientScheduler and WifiScanningScheduler

And move them to the com.android.server.wifi.scanner package

Change-Id: Iceac6823f118017f577e316d8eacc77c3445b2a7
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/scanner/BackgroundScanSchedulerFilterTest.java
rc/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java
dc69106e28e9a6755b1454467f65761f7cbb59c9 17-Mar-2016 Glen Kuhne <kuh@google.com> Merge "Various WifiMetrics fixes" into nyc-dev
96cdfc0acafef88832515ecc52c01638c1493211 11-Mar-2016 Glen Kuhne <kuh@google.com> Various WifiMetrics fixes

-WifiMetrics now determines if repeated 'startConnectionEvent' are for
the same attempt, and adds the failure code
FAILURE_REDUNDANT_CONNECTION_ATTEMPT to designate this.
-Added end condition for roaming timeouts
-Modifed the naming of all failures to be less cryptic
-level_2_failure_code will now be used to log all failure reasons
(making ConnectivityLevelFailure a redundant subset)
-Started using ScanResult frequency instead of WifiConfiguration for
'ChannelInfo'
-Added AuthType checking on 'startConnectionEvent' (Also doing it when
we receive scanResults after associating with the BSSID)
-Refactored all of the config stuff out of startConnectionEvent() into
updateFromWifiConfiguration

BUG=25691077

Change-Id: Id1de2d5dea88611f81e58fed71e6b4e0ee88159a
rc/com/android/server/wifi/WifiMetricsTest.java
2d211b1809081bce900a5cbb890aca7c93d252c3 17-Mar-2016 Roshan Pius <rpius@google.com> Merge changes I05684ce1,Icb1037ed,I1acf704a into nyc-dev

* changes:
SupplicantWifiScannerImpl: Sw Pno scans
HalWifiScanner: Create SupplicantScanner delegate
SupplicantWifiScannerImpl: Report Pno events
4668a26b24f37d6f10f3d94c3674efde0efacb72 17-Mar-2016 Ningyuan Wang <nywang@google.com> Merge "Wifi country code refactoring" into nyc-dev
4d34108cedea793f789372593404cdd186d338eb 16-Mar-2016 Mitchell Wills <mwills@google.com> Add instructions to the readme on generating code coverage

Change-Id: Idfdce7cb1f037b7a3b4d2e2cddfe8ee26e5858e2
EADME.md
62bc101940ae1f5e60c4d8861a149b900dbf5e5c 16-Mar-2016 Roshan Pius <rpius@google.com> SupplicantWifiScannerImpl: Sw Pno scans

If the hardware does not support PNO scans via wpa_supplicant,
we need to perform a periodic background scan.
Add a new flag called swPnoScan to take care of this and use the flag
hwPnoScan for HW based PNO scans. All SW pno scans will be accompanied
by a background scan request.

BUG: 27525899
Change-Id: I05684ce1ec9081ee2c5935c4d5dae2c0175bb592
TEST: Compiles & unit-test passes
cherry-picked from:
https://partner-android-review.googlesource.com/#/c/540348/10
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/SupplicantPnoScannerTest.java
2332e9ea1b691fa0ea3a340feec159f2040aa6ca 14-Mar-2016 Roshan Pius <rpius@google.com> HalWifiScanner: Create SupplicantScanner delegate

We need to use supplicant scans for all single shot scans and
for PNO scans (on some devices like shamu) even when HAL based gscan is
supported. So, create a supplicant scanner delegate in HalScannerImpl to
use for single scans & Pno scans (if device does not support ePno).

This helps us get rid of all supplicant scan code currently present in
HalWifiScannerImpl.

While there,
Moved all the methods in both Hal & Supplicant ScannerImpl to be in the
same order.

BUG: 27600810
Change-Id: Icb1037ed3599db2a9770802dd78edfb885bde452
TEST: Compiles & unit-test passes
cherry-picked from:
https://partner-android-review.googlesource.com/#/c/542729/
rc/com/android/server/wifi/HalWifiScannerTest.java
d02611ce4158fda6c2d14ee13ad7f9553f416d21 02-Mar-2016 Ningyuan Wang <nywang@google.com> Wifi country code refactoring

This CL pulls coutry code logic into one class.
This also refactors all the existing country code logic.
We do not set country code for P2p interface now because
this is redundant. wpa_supplicant will route all the request
to the real interface.
Some initial unittests are added.

Bug: 27477896
TEST: compile, runtest frameworks-wifi,
manually tested with an angler phone
Change-Id: I870c3ad615a1f9bfb3fb40b149b9ca71dc850cdd
rc/com/android/server/wifi/WifiCountryCodeTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
7462584f8a30f6dba5dc979b3dfbe3821b739d9c 15-Mar-2016 Wei Wang <weiwa@google.com> Merge "Fix native crash caused by null rtt params." into nyc-dev
80fcd6da60c59a395c4154feae75d1015bc9691e 15-Mar-2016 Mitchell Wills <mwills@google.com> Fix build errors brought on by enabling more warnings

Change-Id: I28ec0ccc5280cbd77da90f97e0727ad883357134
ni/wifi_nan_hal_mock.cpp
208f92c4d8457374ff507996d58ffa5586d1ecd5 25-Feb-2016 Mitchell Wills <mwills@google.com> Add some more jni compiler errors

Bug: 27360209
Change-Id: I01575f17a37e34aae9f158133bff9baed8fd8ab1
ndroid.mk
ni/wifi_hal_mock.cpp
202fdf96e1e0191be37a916d97116df35fe3cbfc 22-Feb-2016 Wei Wang <weiwa@google.com> Fix native crash caused by null rtt params.

Bug:27227320

Change-Id: I822045f2dd35aeb824cea0d0c0791480e0d1b80a
rc/com/android/server/wifi/RttManagerTest.java
rc/com/android/server/wifi/RttServiceTest.java
ef7480f78d994c786248a1ee8a601abf39aec696 11-Mar-2016 Glen Kuhne <kuh@google.com> resolve merge conflicts of ea91131081 to nyc-dev

Change-Id: I0662ccf4f80c3b0b48314aef3a5807ce27a13659
637a86ffb3a036a4f26a471378b57d8817f35c25 08-Mar-2016 Glen Kuhne <kuh@google.com> Created WifiInjector, dependency injector for wifi

Created a new class WifiInjector, a lazy singleton for dependency
injection. Initial use case was accessing WifiMetrics from within
WifiScanningService, will allow for easy mocking, and is a potential
candidate to replace the mess that is FrameworkFacade.

BUG=27550630
BUG=25691077

Change-Id: I0b1a99f718912fe6ee9a1453ff275b5dfedce6fd
rc/com/android/server/wifi/WifiStateMachineTest.java
1c3442a6f4f3966b25ab35b70e806e34b0674092 11-Mar-2016 Roshan Pius <rpius@google.com> Merge changes Ib8c98c06,I0731192d,I7d03b43b into mm-wireless-dev
am: b92d0785aa

* commit 'b92d0785aa1bb8ac828b067ce1c938f447c8ac7a':
WifiScanningServiceImpl: Add PNO active scans map
Pause PNO scans for single scan
Refactor WifiScanner support for oneshot scans
b92d0785aa1bb8ac828b067ce1c938f447c8ac7a 11-Mar-2016 Roshan Pius <rpius@google.com> Merge changes Ib8c98c06,I0731192d,I7d03b43b into mm-wireless-dev

* changes:
WifiScanningServiceImpl: Add PNO active scans map
Pause PNO scans for single scan
Refactor WifiScanner support for oneshot scans
d8a7585df4bc589d3905631a3dc0990731fe0086 10-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Make sure all tests are annotated with a size" into mm-wireless-dev
am: 2686a7163f

* commit '2686a7163fb2e06fa2228d93204c27d3b41b6a27':
Make sure all tests are annotated with a size
2686a7163fb2e06fa2228d93204c27d3b41b6a27 10-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Make sure all tests are annotated with a size" into mm-wireless-dev
28345f81bf3f95e25946d398d594f39141c41442 05-Mar-2016 Mitchell Wills <mwills@google.com> Make sure all tests are annotated with a size

Bug: 27428545
Change-Id: I98e9c28a22190b6455bb74bbee54f558f6574612
rc/com/android/server/wifi/WifiMetricsTest.java
rc/com/android/server/wifi/scanner/ChannelHelperTest.java
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
rc/com/android/server/wifi/scanner/NoBandChannelHelperTest.java
cc1d874560e4c0ca157bfda5d12df33a4f50fc11 10-Mar-2016 Mitchell Wills <mwills@google.com> Merge changes from topic \'wifi_scanner_hidden_network_ids\' into mm-wireless-dev
am: 01fb5b27ba

* commit '01fb5b27ba32f180080f2b2b12adbc5c803611ce':
Allow multiple Handlers to be registered for a WifiMonitor event
WifiScanner: Changes to support hidden Network Ids
8adb4e72f58e3e25918f33e0b2687e6acc14c47d 04-Nov-2015 Mitchell Wills <mwills@google.com> Refactor WifiScanner support for oneshot scans

Seperate oneshot scans so they are no longer implemented using
background scans and make WifiStateMachine use WifiScanner for single
scans.

This changes requires a few parts:
1. Implement single scan logic in WifiScanningServiceImpl for merging
and executing scan requests using the single scan native interface.
2. Writing tests for the new code in 1
3. Make supplicant start scans by using WifiScanner and when it
recieves callbacks dispatch scan complete/failure messages.
4. Enable HalWifiScannerImpl and SupplicantWifiScannerImpl to listen to
supplicant scan events now that WifiStateMachine does not.

Bug: 26525037
Bug: 26895774
Change-Id: I7d03b43bbd2be396b3c772bc4bae681acce8eb7b
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
d74ff28cdb01d3f711e0b0f0e99e51fdb221eaf2 07-Mar-2016 Roshan Pius <rpius@google.com> WifiScanner: Changes to support hidden Network Ids

Add the required plumbing to support scanning for hidden networks via
wpa_supplicant.
Added a test case to verify that the network ID list is being sent
as expected.

BUG: 27503786
Change-Id: I2d1ef74494080e01248ae8aad5081c7608fc0e81
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
838e8915ad29a380254f4bb77293badb949b4b1b 08-Mar-2016 Glen Kuhne <kuh@google.com> Merge "Add Supported Rates and 802.11 Mode detection" into mm-wireless-dev
am: 9947ed6dfd

* commit '9947ed6dfddffe1746d98bf01499a81d7c3de123':
Add Supported Rates and 802.11 Mode detection
9947ed6dfddffe1746d98bf01499a81d7c3de123 08-Mar-2016 Glen Kuhne <kuh@google.com> Merge "Add Supported Rates and 802.11 Mode detection" into mm-wireless-dev
c1e99e6dbd1871c02e35497478247ddc9f8dba61 08-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Ensure ADB is running as root when generating coverage" into nyc-dev
699238e909ebaee0b7f759c4d04efabe75813789 07-Mar-2016 Mitchell Wills <mwills@google.com> Correctly filter results by time from supplicant in Hal scan impl
am: 2e0b845b65

* commit '2e0b845b65b2e2151cddbdafb90bd0f744b10654':
Correctly filter results by time from supplicant in Hal scan impl
2e0b845b65b2e2151cddbdafb90bd0f744b10654 05-Mar-2016 Mitchell Wills <mwills@google.com> Correctly filter results by time from supplicant in Hal scan impl

Bug: 27358828
Change-Id: Ic9ddfa02a0e3c282871ddfa3347312a5917dbec0
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/ScanResults.java
0a21d6c371532509c566ddf1cc485f99f1abdb57 07-Mar-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigManager: Change PNO network list type" into mm-wireless-dev
am: 3a2b55ba28

* commit '3a2b55ba283dec0d3e3421bdd27568ad0644bd7e':
WifiConfigManager: Change PNO network list type
3a2b55ba283dec0d3e3421bdd27568ad0644bd7e 07-Mar-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigManager: Change PNO network list type" into mm-wireless-dev
f5cc6a0c7ede374b33de1cf5156bf149e2e76c13 01-Mar-2016 Glen Kuhne <kuh@google.com> Add Supported Rates and 802.11 Mode detection

Added an Information Element parser for Supported and Extended Supported
Rates.
Uses this information and other IEs to determine the 802.11 Mode
(a/b/g/n/ac) being used by APs, stores it in their scan results.
Modified WifiMetrics to receive and store this metric from a ScanDetail
Added calls to WifiMetrics from WifiStateMachine to give it a ScanDetail
Minor fix to WifiStateMachine's tracking of TargetNetworkId, which it
was clearing incorrectly on NETWORK_DISCONNECTION_EVENT

BUG=25691077
BUG=27446779
Change-Id: I63af5911916bfec87628aeb4e1ed4f9138acfafa
rc/com/android/server/wifi/WifiMetricsTest.java
0855f2c5d14fa420eeb3a8a97c142671c9943329 07-Mar-2016 Mitchell Wills <mwills@google.com> Ensure ADB is running as root when generating coverage

If ADB is not already running as root the script will fail because
accessing the test app's data requires root.

Change-Id: Ie93a1597706fae45d6eb34be54761a6f80380110
overage.sh
f38ce9684dc1e5eeae48ef45a75d10c6d738046f 07-Mar-2016 Roshan Pius <rpius@google.com> Merge "PNO: Changes in Native for new interface" into mm-wireless-dev
am: ffe70f78d0

* commit 'ffe70f78d0aca71e9c5af82f11472d422f14b301':
PNO: Changes in Native for new interface
ffe70f78d0aca71e9c5af82f11472d422f14b301 07-Mar-2016 Roshan Pius <rpius@google.com> Merge "PNO: Changes in Native for new interface" into mm-wireless-dev
8c0c14b2c98bc26e6a09f66cff1244f0a30f44cb 05-Mar-2016 Roshan Pius <rpius@google.com> WifiConfigManager: Change PNO network list type

Change the PNO network list type from WifiNative to WifiScanner type
since that is the new public interface for starting PNO scans.

1. Remove the PnoNetwork constructore from WifiNative
2. Create a temporary conversion function in WifiStateMachine to
convert to WifiNative.PnoNetwork.

BUG: 27167559
Change-Id: I7c845321eab20f822f5d7d5231294181343ef2be
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiConfigManagerTest.java
9bd01d6cb65ea96d6729d35a1fc43bb2bb40e3bd 02-Mar-2016 Roshan Pius <rpius@google.com> PNO: Changes in Native for new interface

Changes in WifiNative to accomodate the new Scanner based PNO interface.
Currently, we're just setting the |wifi_epno_network| list member in
|wifi_epno_params| structure. All the other values are being ignored.

1. Change the native |android_net_wifi_setPnoListNative| to accept the
PNO settings parameter instead of directly accepting the list of
networks.
2. Changes in WifiNative to send down the new |PnoSettings| structure
down to the native code instead of directly sending the list.
a. Keep the existing interface from |WifiStateMachine| which accepts a
|PnoNetwork| list and converts it into |PnoSettings| structure.
This interface will be removed once all the new Scanner based
interface plumbing is complete.
3. Add a separate native API to reset PNO list.

While there,
Remove redundant "Wifi" prefix from Pno class names.

BUG: 27167559
Change-Id: I78d35c20b4bb7a12c51d0c2cc609fb7bcb5ae516
TEST: Compiles & unit-test passes
rc/com/android/server/wifi/WifiConfigManagerTest.java
b51e54f90373ec8cfcf57cc67f495dc831d8f5b4 05-Mar-2016 Roshan Pius <rpius@google.com> Merge "Send list of hidden networkID for supplicant scan" into mm-wireless-dev
am: 6b0c636d0a

* commit '6b0c636d0a97e6163a99a8fbf5c199998c1be770':
Send list of hidden networkID for supplicant scan
3d995b8a3a508e957e3dac2e508956020cd9abfe 04-Mar-2016 Roshan Pius <rpius@google.com> Send list of hidden networkID for supplicant scan

Since we disable all the networks in wpa_supplicant (as of b/26984166),
we need to explicitly send the list of hidden ssid's to scan.

1. Use the 'scan_id' override to send a lit of hidden networkId's to
supplicant.
2. Add a new set of hidden networkId's in ConfigurationMap which can be
used as parameter for the above.
3. Add a test to start scan with a hidden network added.

BUG: 27471630
TEST: Verfied that we auto-connect to a hidden ssid.
TEST: `runtest frameworks-wifi`

Change-Id: I8aea09d1ec2f24310959a558e8b12d31a26d179c
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
90ee0a6ad4ce8ac3280fd07a0b148d82678fc6a0 03-Mar-2016 mukesh agrawal <quiche@google.com> Merge "make ringbuffer size configurable" into mm-wireless-dev
am: 3e3ad8dfb0

* commit '3e3ad8dfb0eddfc98ed21ce51a96a28924fe8c14':
make ringbuffer size configurable
762e4ccc42148315dbd4c4c6aae14e0c45d78588 03-Mar-2016 mukesh agrawal <quiche@google.com> Merge "WifiLogger: manage ring buffers by bytes" into mm-wireless-dev
am: 84f4423601

* commit '84f44236019a1ae41739984c12eccdd14ca97e3f':
WifiLogger: manage ring buffers by bytes
f19b89324583cf23eb5cea9b5f94810a5a5825c5 03-Mar-2016 mukesh agrawal <quiche@google.com> Merge "add ByteArrayRingBuffer" into mm-wireless-dev
am: 00ed767aee

* commit '00ed767aee2b1eaef10b849a27f1ce6bda43f83f':
add ByteArrayRingBuffer
3e3ad8dfb0eddfc98ed21ce51a96a28924fe8c14 03-Mar-2016 Mukesh Agrawal <quiche@google.com> Merge "make ringbuffer size configurable" into mm-wireless-dev
84f44236019a1ae41739984c12eccdd14ca97e3f 03-Mar-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiLogger: manage ring buffers by bytes" into mm-wireless-dev
00ed767aee2b1eaef10b849a27f1ce6bda43f83f 03-Mar-2016 Mukesh Agrawal <quiche@google.com> Merge "add ByteArrayRingBuffer" into mm-wireless-dev
c42e29a329fabcbcb9868f4966c106f865a199e8 03-Mar-2016 Mitchell Wills <mwills@google.com> Merge "Update scan band channels when needed" into mm-wireless-dev
am: 25d25de358

* commit '25d25de358ece952e16420a89dd899ebed46f77a':
Update scan band channels when needed
a54db13528fa8b586d58b42aff46df40466ea950 02-Feb-2016 Mitchell Wills <mwills@google.com> Add coverage support for Wifi unit tests

This adds a script to automatically run the tests and generate a
coverage report.

Bug: 26958680
Change-Id: I139be7065ddd3c20f6e813191d4993bd1b9377e6
ndroid.mk
overage.sh
fef1495477206d4cabfc95325d71de41790cf9cc 02-Mar-2016 mukesh agrawal <quiche@google.com> make ringbuffer size configurable

Different builds of the WiFi service may want to have different
ring buffer sizes. To allow for this, have the WiFi service
consult Resources for the size to use.

BUG=27264418
TEST=unit tests
TEST=add Log call in WSM ctor, verify size from values.xml was used

Change-Id: Ie6adc9efe107dfeaf4894aaff35c0beb6f7f9819
rc/com/android/server/wifi/WifiLoggerTest.java
b46c550a7305e6c42af4ca92a964b801c33f1f72 02-Mar-2016 mukesh agrawal <quiche@google.com> WifiLogger: manage ring buffers by bytes

At present, we manage the ring buffers by the number of
entries, rather than the number of bytes. Since the size
of an entry is variable, managing by the number of entries
doesn't give us solid control over the amount of memory
used.

To solve this, switch from LimitedCircularArray<byte[]>, to
ByteArrayRingBuffer. ByteArrayRingBuffer limits the number of
bytes, rather than the number of entries.

To facilitate testing, make two of WifiLogger's inner classes
(BugReport and LimitedCircularArray) package-private, instead
of strictly private.

BUG=27264379
TEST=(new) unit tests

Change-Id: I2ed6557bd0b40db3227e1e22ea7ff9f8a27ab2ba
rc/com/android/server/wifi/WifiLoggerTest.java
cc84bc6179db408b1e45168d43e10ba0ab089fca 01-Mar-2016 mukesh agrawal <quiche@google.com> add ByteArrayRingBuffer

We want to manage the debug ring buffers by total spaced used,
rather than by the number of entries in the ring. Add a new
class, ByteArrayRingBuffer, to provide the needed functionality.

BUG=27264379
TEST=(new) unit tests

Change-Id: I6e1ce82e028fc621f3fc9c96a5cb0cbd71c2d4e3
rc/com/android/server/wifi/ByteArrayRingBufferTest.java
e6d8fa5fb50afdfc04922f7f87c2cac08db5bbec 29-Feb-2016 Mitchell Wills <mwills@google.com> Update scan band channels when needed

The involves adding an ability to channel helper to trigger a channel
list update.

Bug: 27381346
Change-Id: I7908018ff8136b9ce7880d5090bbe9e6fb63405d
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
284104601631c2bab2ff220876a4d71ccf843f52 01-Mar-2016 Erik Kline <ek@google.com> Call IpManager\'s dependency injection constructor
am: 3fff931f15

* commit '3fff931f15b78dc75376506d98782393452d4c56':
Call IpManager's dependency injection constructor
3fff931f15b78dc75376506d98782393452d4c56 01-Mar-2016 Erik Kline <ek@google.com> Call IpManager's dependency injection constructor

Bug: 27406552
Change-Id: I75e01766829d15f219d72621b654c566189ae989
rc/com/android/server/wifi/WifiStateMachineTest.java
e27341c71aa34f49dfc90d1ebee1e5eadb6a4605 29-Feb-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigManager: Refactor remove network" into mm-wireless-dev
am: 60c716a0ed

* commit '60c716a0ed1549fe9e3e9e8528abc284f32a8aba':
WifiConfigManager: Refactor remove network
6a229f790826761b79d5b71e01d7238299c81eff 27-Feb-2016 Roshan Pius <rpius@google.com> resolve merge conflicts of 2d65b9aaaa to nyc-dev

Change-Id: I52c055a8b26d01745d3378ef062faab9952ee393
dc61ad4fe8a84909a288af50a8b187c98e2194b6 26-Feb-2016 Roshan Pius <rpius@google.com> WifiConfigManager: Refactor remove network

Move the actual removal of network from database into a common utility
method which can be invoked in handleUserSwitch & removeNetwork.

This CL is part 1 of refactoring some repeating patterns in
WifiConfigManager.

BUG: 27364882
Change-Id: I374a31f4d5cf4d7ec480b9b40f26af33e1deb8b1
TEST: `runtest frameworks-wifi`
rc/com/android/server/wifi/WifiConfigManagerTest.java
2d65b9aaaa740ecf66bf4734c12aea3df88e352a 24-Feb-2016 Roshan Pius <rpius@google.com> WifiConfigStore: New WifiConfigStore (Part 2)

Integrate the new WifiConfigStore into WifiConfigManager class.
Most of the public methods that have been moved to ConfigStore have been
stubbed out in WifiConfigManager. Some of the methods have been changed
to make it consistent with the other methods.

The end goal of this CL to remove all WifiNative usages in
WifiConfigManager class.

Other related changes:
1. Changes in unit-tests to use mock wifiNative everywhere.
2. Change WifiConfigManager to accept an instance of KeyStore so that it
can be mocked out in unit-tests.

BUG=27299172
TEST:`mmma -j32 frameworks/opt/net/wifi/service/ && runtest
frameworks-wif`

Change-Id: I1656d81aec0ae3337bd794541b5a0bde9cddd48e
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
52da3dd6345bb068b0f0ec8fd6a749b2ee977d89 26-Feb-2016 Glen Kuhne <kuh@google.com> Merge "Add makeWifiConfigManager() to FacadeFramework" into mm-wireless-dev
am: 2bdcccb7ba

* commit '2bdcccb7badf35e9e00ea0b3b8e315f3f77af86a':
Add makeWifiConfigManager() to FacadeFramework
2bdcccb7badf35e9e00ea0b3b8e315f3f77af86a 26-Feb-2016 Glen Kuhne <kuh@google.com> Merge "Add makeWifiConfigManager() to FacadeFramework" into mm-wireless-dev
d8801e6ae46f95b2adb6e374c96b6b5d7ca64879 26-Feb-2016 Randy Pan <zpan@google.com> Correct WifiQualifiedNetworkSelection file name
am: 2177731ae0

* commit '2177731ae0a49be7dd66fd05dfb0ca73831b062c':
Correct WifiQualifiedNetworkSelection file name
8f852de7a8f081aff36bc9896781b270ca88d0e8 25-Feb-2016 Glen Kuhne <kuh@google.com> Add makeWifiConfigManager() to FacadeFramework

Added a function to FacadeFramework to make WifiConfigManager, replaced
the constructor in WifiConfigManager unit tests with this function.

BUG=27359698

Change-Id: Id9c0e6757244527e7f5fe7143687a32dd8d96c58
rc/com/android/server/wifi/WifiStateMachineTest.java
62681bff4b0c7eadf35546f6e6f35a19268e87a3 26-Feb-2016 Glen Kuhne <kuh@google.com> WifiMetric ConnectionEvent logging refactor
am: 4dead162c5

* commit '4dead162c5336443e9d7b3deae5eb26b07d39254':
WifiMetric ConnectionEvent logging refactor
2177731ae0a49be7dd66fd05dfb0ca73831b062c 26-Feb-2016 Randy Pan <zpan@google.com> Correct WifiQualifiedNetworkSelection file name

Rename WifiQualifiedNetworkSelection to
WifiQualifiedNetworkSelector to be consistent with the class
name.

Bug: 27296738
Change-Id: I48d21b1361cc2331b09cab84282eb47017be7f23
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectorTest.java
4dead162c5336443e9d7b3deae5eb26b07d39254 19-Feb-2016 Glen Kuhne <kuh@google.com> WifiMetric ConnectionEvent logging refactor

Modified the placement of start & end-ConnectionEvent() calls in
WifiStateMachine and the Roam Types they use, to more accurately describe
the types of connection events that are occuring.
Improved the human readability of metrics when as part of 'dumpsys
wifi'.

BUG=25691077
Change-Id: Ia8bd8415cab0feec476e012fd1b0bfa358e35e52
rc/com/android/server/wifi/WifiMetricsTest.java
9456d35ba321fa5e9cd629e416bb8bb78e8166e4 25-Feb-2016 Paul Stewart <pstew@google.com> Merge "WifiNotificationController: Ignore "SCANNING" network state" into mm-wireless-dev
am: e08c8038a4

* commit 'e08c8038a432eb68a3493abdfa7e69d92bad3b80':
WifiNotificationController: Ignore "SCANNING" network state
e08c8038a432eb68a3493abdfa7e69d92bad3b80 25-Feb-2016 Paul Stewart <pstew@google.com> Merge "WifiNotificationController: Ignore "SCANNING" network state" into mm-wireless-dev
a73697c129a759ab403dfc6929aadfa71ea52141 25-Feb-2016 Peter Qiu <zqiu@google.com> Merge "Use a wrapper for BackupManager" into mm-wireless-dev
am: ac90154934

* commit 'ac90154934c0daf4e69a6d38344b82eea8dee91b':
Use a wrapper for BackupManager
ac90154934c0daf4e69a6d38344b82eea8dee91b 25-Feb-2016 Peter Qiu <zqiu@google.com> Merge "Use a wrapper for BackupManager" into mm-wireless-dev
750c6962838af6ab7ba034c80f2d325df7e74cbe 23-Feb-2016 Peter Qiu <zqiu@google.com> Use a wrapper for BackupManager

This avoids invoking calls to BackupManager/BackupManagerService during
unit test.

Bug:27296824
TEST=runtest frameworks-wifi

Change-Id: I3d4fe1b4d2fdabe079e65242099f4dd4ed4ab7f4
rc/com/android/server/wifi/WifiApConfigStoreTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
fbeef71cf8251d4537f1ba65484f39d78c14b81b 24-Feb-2016 Etan Cohen <etancohen@google.com> Merge changes I9921d663,Ib9d42823,Ia0be2203,I09b28da3 into mm-wireless-dev

* changes:
[NAN] Increase coverage [DO NOT MERGE]
[NAN] Enable testing of apps faking client IDs [DO NOT MERGE]
[NAN] Add code to clean-up after all (even No-Op) transactions [DO NOT MERGE]
[NAN] Replace crashing on illegal state to failure response/ignore [DO NOT MERGE]
cc0da689f0cf3e5b5e3a0b43a8d571fd1911efec 24-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] Increase coverage [DO NOT MERGE]

Increase test coverage:
- Stop sessions
- Callbacks with invalid ID

Bug: 27257090
Change-Id: I9921d663fb88905b7e163eb0251e0afabfb30ccf
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
5c0a79c305877c8c96df69035eed38c3650dfa5b 24-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] Enable testing of apps faking client IDs [DO NOT MERGE]

Enable mocking of UIDs. Enables testing of multiple apps (each with
its own UID) trying to access 'invalid' client IDs - i.e. client IDs
which were created by different UIDs.

Bug: 27335234
Change-Id: Ib9d4282378d144a51d83229ed4d924a49375fd11
rc/com/android/server/wifi/nan/WifiNanServiceImplTest.java
4f1887493430b6b61126f233f3de54201b363145 24-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] Add code to clean-up after all (even No-Op) transactions [DO NOT MERGE]

Some transactions have no app-facing callbacks - e.g. cancelling a publish
or subscribe (app assumes it succeeds). In such cases still need to clean
up the internal transaction tracking state. Add No-Op callback in state
manager to perform that clean-up.

Add tests for above as well as for unknown transaction callback: i.e.
response codes from HAL which aren't "known" (not handled, possibly
yet).

Bug: 27334871
Change-Id: Ia0be220310689c0e06030b71236d955a557b7a27
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
e903e3cb1e7a41fa20306dc3bd1f3518c51a8a86 24-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] Replace crashing on illegal state to failure response/ignore [DO NOT MERGE]

Do not crash NAN service (i.e. system service) when illegal state or illegal
inputs are detected (especially inputs - since can be created by bad/malicious
app). Instead either ignore or respond with failure callbacks.

Bug: 27334919
Change-Id: I09b28da3bea396633dbe76f729c276f9e5620c5d
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
88f11e563905c9a5e78015fc151f86fa903f956a 24-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Enable -Wall and -Werror for all native code" into mm-wireless-dev
am: 9046ceefcd

* commit '9046ceefcd633584d3a690e4a3f633312c384dc7':
Enable -Wall and -Werror for all native code
9046ceefcd633584d3a690e4a3f633312c384dc7 24-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Enable -Wall and -Werror for all native code" into mm-wireless-dev
2ef14db559ceee38b4e9d86eab8196cea4749d76 24-Feb-2016 Glen Kuhne <kuh@google.com> Merge "WifiConfigStore Refactor read&write NetworkHistory" into mm-wireless-dev
am: 5eb49f6169

* commit '5eb49f61695e122d5c9c3a1b89a0ce1a6474f195':
WifiConfigStore Refactor read&write NetworkHistory
5eb49f61695e122d5c9c3a1b89a0ce1a6474f195 24-Feb-2016 Glen Kuhne <kuh@google.com> Merge "WifiConfigStore Refactor read&write NetworkHistory" into mm-wireless-dev
c1996c9f9334d0da0e931acf92eaf7e936de6e40 24-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Replace WifiChannelHelper with ChannelHelper implementations" into mm-wireless-dev
am: b1a4d1c1bb

* commit 'b1a4d1c1bb210c702d20006517b74b6375480313':
Replace WifiChannelHelper with ChannelHelper implementations
b1a4d1c1bb210c702d20006517b74b6375480313 24-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Replace WifiChannelHelper with ChannelHelper implementations" into mm-wireless-dev
c485ebf64d1049d17db8108b85653f53fcdc8949 23-Feb-2016 Glen Kuhne <kuh@google.com> WifiConfigStore Refactor read&write NetworkHistory

Created a new helper class: WifiNetworkHistory
Moved readNetworkHistory() and writeKnownNetworkHistory() from
WifiConfigStore into this class, replacing them with calls to the
helper.

BUG=27294533
Change-Id: I10d43e3fd37e251d1845ef726fea0faf136d9626
rc/com/android/server/wifi/WifiConfigManagerTest.java
250e70cb113e75ac9b24b09bbf176804d37755d8 09-Feb-2016 Paul Stewart <pstew@google.com> WifiNotificationController: Ignore "SCANNING" network state

While the system is disconnected and does screen-on scanning,
it is legitimate to see temporary state changes to the "SCANNING"
state then back to "DISCONNECTED". The current implementation
of WifiNotificationController resets its scan counter during
these transitions, and therefore never displays the "WiFi
Networks Avaialable" notification. This CL fixes this problem
by separately tracking NetworkInfo.DetailedState and ignoring both
"SCANNING" and the no-op state changes that will happen as a
result.

BUG=26076402
TEST=New unit test included in CL
TEST=Repeat bug reproduction steps

Change-Id: I5e6049edb767e4f67be1ddb31023a28043db53d5
rc/com/android/server/wifi/TestUtil.java
rc/com/android/server/wifi/WifiNotificationControllerTest.java
1abd49f3445df5d221319a1571c1a0dda3ecab79 24-Feb-2016 Paul Stewart <pstew@google.com> Merge "WifiStateMachine: Only respond once to multiple EAP-SIM challenges" into mm-wireless-dev
am: af8f9541d2

* commit 'af8f9541d248f7e1ca8232774de1310838ef4b0a':
WifiStateMachine: Only respond once to multiple EAP-SIM challenges
af8f9541d248f7e1ca8232774de1310838ef4b0a 24-Feb-2016 Paul Stewart <pstew@google.com> Merge "WifiStateMachine: Only respond once to multiple EAP-SIM challenges" into mm-wireless-dev
87af62a5bfe014ff3e62a14d90e168741636da0c 24-Feb-2016 Roshan Pius <rpius@google.com> Merge "Disable all networks in supplicant" into mm-wireless-dev
am: e2dc63bb99

* commit 'e2dc63bb990eed0f1909f8f38cbfb0d2f4bc2a92':
Disable all networks in supplicant
e2dc63bb990eed0f1909f8f38cbfb0d2f4bc2a92 24-Feb-2016 Roshan Pius <rpius@google.com> Merge "Disable all networks in supplicant" into mm-wireless-dev
7e3e85327ca82a83de84b4750e793f2e3d1b3bfc 06-Feb-2016 Mitchell Wills <mwills@google.com> Replace WifiChannelHelper with ChannelHelper implementations

Change-Id: I20c266825e3b0b0566d6d2939ca2d0c67d213d78
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
e6836f2c82e277ba412c7543aca239ace041940e 23-Feb-2016 Paul Stewart <pstew@google.com> Merge "Fix string comparison in Enterprise Config tests" into mm-wireless-dev
am: 290ee2a917

* commit '290ee2a917976be96c978ae7340cba5e35e1b019':
Fix string comparison in Enterprise Config tests
290ee2a917976be96c978ae7340cba5e35e1b019 23-Feb-2016 Paul Stewart <pstew@google.com> Merge "Fix string comparison in Enterprise Config tests" into mm-wireless-dev
e8a8e5a4b6e0e01474c48f277b7ce714185cd9f2 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Remove use of MockLooper AutoDispatch from non-blocking calls" into mm-wireless-dev
am: 2150117638

* commit '21501176384e4312dce3a51b8ae8ca132f5d9ab4':
Remove use of MockLooper AutoDispatch from non-blocking calls
09aa045a936a651d49c59a4cea8eff25b0dbc021 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Create blocking call for AutoDispatch test." into mm-wireless-dev
am: d79059c102

* commit 'd79059c1029e4079fb5107a4788d24ce40eda7c5':
Create blocking call for AutoDispatch test.
21501176384e4312dce3a51b8ae8ca132f5d9ab4 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Remove use of MockLooper AutoDispatch from non-blocking calls" into mm-wireless-dev
d79059c1029e4079fb5107a4788d24ce40eda7c5 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Create blocking call for AutoDispatch test." into mm-wireless-dev
df3474577e5f4c613f62d50346daf5ac8d772283 23-Feb-2016 Peter Qiu <zqiu@google.com> Merge "WifiStateMachineTest: use mock WifiApConfigStore" into mm-wireless-dev
am: f1819c969c

* commit 'f1819c969c2b9c626c7f5845b48772494c4e0ac5':
WifiStateMachineTest: use mock WifiApConfigStore
f1819c969c2b9c626c7f5845b48772494c4e0ac5 23-Feb-2016 Peter Qiu <zqiu@google.com> Merge "WifiStateMachineTest: use mock WifiApConfigStore" into mm-wireless-dev
dad21481f7856586e17c01b391a0329a11eab722 23-Feb-2016 Paul Stewart <pstew@google.com> Fix string comparison in Enterprise Config tests

This rectifies an issue with using "==" for string comparison.
This caused this test to fail on certain platforms.

BUG=27278732

Change-Id: Ifc7d36f4586428e19467813005a5d8bb74e16662
rc/android/net/wifi/WifiEnterpriseConfigTest.java
9d7489491984e86915b2cf4fac38a882de1c8cdb 09-Feb-2016 Roshan Pius <rpius@google.com> Disable all networks in supplicant

Temporary changes to test if we can disable all the networks in
supplicant conf file except the one we want to connect to.

Changes:
1. Remove all existing native enableNetwork invocations and replace
it with a single selectNetwork call in |WifiConfigStore.selectNetwork|.
selectNetwork enables the provided network and disables all others in
wpa_supplicant.
2. Enable all networks in wpa_supplicant before enabling PNO. These will
be disabled when we come out of PNO and decide to conneect to one of
them via selectNetwork.
3. Save the network status in networkHistory.txt and ignore the status
stored in wpa_supplicant.conf.
4. Some other cleanups:
a. Remove |enableNetworkWithoutBroadcast| definition/usages and
replace with |selectNetworkWithoutBroadcast|.
b. Add enableAllNetworksNative/disableAllNetworksNative methods to
just enable the network in wpa_supplicant.
c. Move all wpa_supplicant network enable/disable to a common API.
d. Fixed all the unit-test expectations.

BUG:26984166
TEST: `mmma frameworks/opt/net/wifi/tests && runtest frameworks-wifi`

Change-Id: Ib5a089f054557071ece6be25aad03b6458c0217c
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
3116dea7fa16bb41327c4311110d8e21ffe8c794 23-Feb-2016 Peter Qiu <zqiu@google.com> WifiStateMachineTest: use mock WifiApConfigStore

This avoids writing of AP config file during unit tests.

Bug: 27311680
TEST=runtest frameworks-wifi

Change-Id: If6f534f7eeca8a37acf9a43b0c30acee0b5e22b9
rc/com/android/server/wifi/WifiStateMachineTest.java
823af138d63dc96224976b2a5ad6e9b1b224581e 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Remove use of MockLooper AutoDispatch from non-blocking calls

AutoDispatch is not needed with non-blocking sendMessage calls. Remove
two instances of this error.

BUG=27278081

Change-Id: Id346d76e971c361149ae885a8b8056660b61e5f3
rc/com/android/server/wifi/WifiStateMachineTest.java
89901c4bde80282b02a786e580f9bc75984bd4de 23-Feb-2016 Rebecca Silberstein <silberst@google.com> Create blocking call for AutoDispatch test.

Add a blocking call to the testAutoDispatchWithSingleMessage test in
MockLooperTest. AutoDispatch is not intended to be used with non
blocking calls and this corrects the test.

BUG=27278081

Change-Id: I783f763a1b438bf307484276436497e534be3906
rc/com/android/server/wifi/MockLooperTest.java
3cb977400be8d10f06f44dd9b46da70baf2a037a 18-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] API cleanup - rename FLAGS. [DO NOT MERGE]

Per API guidelines - non-overlapping constants can be (should be)
named with "FLAG".

Bug: 27122760
Change-Id: I090c5c6090494240843bf91ab69b6c75072ee2b9
rc/com/android/server/wifi/nan/WifiNanServiceImplTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
434a2a9c1147f8ebdebe434e04e3374d107d80b8 23-Feb-2016 Wei Wang <weiwa@google.com> Merge "Add test case for duplicate listeners in WifiScanner." into mm-wireless-dev
am: 384dc1ae37

* commit '384dc1ae37b7087ed2f15442715ca9f50dd3567c':
Add test case for duplicate listeners in WifiScanner.
384dc1ae37b7087ed2f15442715ca9f50dd3567c 23-Feb-2016 Wei Wang <weiwa@google.com> Merge "Add test case for duplicate listeners in WifiScanner." into mm-wireless-dev
767b3b51641ea9bb5b1b54c0757a3a54824b7f3c 23-Feb-2016 Roshan Pius <rpius@google.com> Rename WifiConfigStore to WifiConfigManager
am: c2a0ff06d5

* commit 'c2a0ff06d58e1cfb9b69fa5b6a8fef5929812f27':
Rename WifiConfigStore to WifiConfigManager
d0be2d83c247d461b3bcee7343b035f1fc92396e 23-Feb-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigStore: Remove IpConfigStore inheritance" into mm-wireless-dev
am: ba035ceba4

* commit 'ba035ceba49da6c3fa4e9407900655ab5cb5e006':
WifiConfigStore: Remove IpConfigStore inheritance
c2a0ff06d58e1cfb9b69fa5b6a8fef5929812f27 22-Feb-2016 Roshan Pius <rpius@google.com> Rename WifiConfigStore to WifiConfigManager

Rename WifiConfigStore class to WifiConfigManager and replace all
existing occurences of WifiConfigStore.
This is in preparation of refactoring WifiConfigStore into a
separate class which will only deal with storing/reading configurations
from a perisistent database.

BUG: 27296463
Change-Id: Ib4c4bd3bdf3fa28771a646e1f3d244f73b690d5e
TEST: Ran unit-tests
rc/com/android/server/wifi/WifiConfigManagerTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
ba035ceba49da6c3fa4e9407900655ab5cb5e006 23-Feb-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigStore: Remove IpConfigStore inheritance" into mm-wireless-dev
c1bc5a14b94276421f741eaebb54daa8e63e4a05 22-Feb-2016 Roshan Pius <rpius@google.com> WifiConfigStore: Remove IpConfigStore inheritance

Move IpconfigStore instance to be a member of the WifiConfigStore and
create a new DelayedDiskWriter for writing the other configurations.

BUG: 27293150
Change-Id: I76654d49848c417599996b0a8b510ff2b04a3d4a
TEST: `runtest frameworks-wifi`
rc/com/android/server/wifi/WifiConfigStoreTest.java
e1facbb854714ec30a92dffc7534acb59442ce3b 23-Feb-2016 Mitchell Wills <mwills@google.com> Enable -Wall and -Werror for all native code

Change-Id: I05a7a0183218da463376e19d78da86dcff8a9cba
ndroid.mk
4d5cbc26f5e14057f194ca49716be2bae17a13b1 22-Feb-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiLogger: add unit test for startLogging()" into mm-wireless-dev
am: d2410df493

* commit 'd2410df493b1da7c9ff9e2026df4e4a30288f080':
WifiLogger: add unit test for startLogging()
d2410df493b1da7c9ff9e2026df4e4a30288f080 22-Feb-2016 Mukesh Agrawal <quiche@google.com> Merge "WifiLogger: add unit test for startLogging()" into mm-wireless-dev
ec1690a8364f678ba8ca4472c8e031d482895533 20-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Add Looper param to WifiStateMachine constructor and AutoDispatch" into mm-wireless-dev
am: 75a3fd9a4d

* commit '75a3fd9a4d37dd6ba1a0ac3e174673e3b80795d1':
Add Looper param to WifiStateMachine constructor and AutoDispatch
75a3fd9a4d37dd6ba1a0ac3e174673e3b80795d1 20-Feb-2016 Rebecca Silberstein <silberst@google.com> Merge "Add Looper param to WifiStateMachine constructor and AutoDispatch" into mm-wireless-dev
d0846fa841b604ccb969c54b45367fa2bececf83 16-Feb-2016 Rebecca Silberstein <silberst@google.com> Add Looper param to WifiStateMachine constructor and AutoDispatch

Add Looper to the WifiStateMachine constructor. This allows unittests to
pass a MockLooper and control how messages are dispatched. This change
allows the wait() calls to be removed from the WifiStateMachineTest
tests and will bring stability to test runs. This change will also
reduce test run time.

Due to the blocking calls in WifiStateMachine that are expecting a
response, also implement AutoDispatch functionality for MockLooper.
This functionality is implemented by creating a thread that calls
MockLooper.dispatchAll when messages are available. Once at least one
message is dispatched, the thread will exit. The thread will attempt a
limited number of times and log an error if no messages are dispatched.

BUG=26943243

Change-Id: Ia892303e04d18c56d7f1d896db6098e7c3bd9607
rc/com/android/server/wifi/MockLooper.java
rc/com/android/server/wifi/MockLooperTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
9aa6d49161f0be66fc89b9b14f7f478e9af407e1 19-Feb-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigStore: API for fetching PNO network list" into mm-wireless-dev
am: d9f96a5827

* commit 'd9f96a58271313deefb135b0606429953157a5f9':
WifiConfigStore: API for fetching PNO network list
d9f96a58271313deefb135b0606429953157a5f9 19-Feb-2016 Roshan Pius <rpius@google.com> Merge "WifiConfigStore: API for fetching PNO network list" into mm-wireless-dev
9a2eb2015d22ee0901c6bce616963643ab3e9e08 19-Feb-2016 Glen Kuhne <kuh@google.com> Merge "InformationElementUtil TIM element parser" into mm-wireless-dev
am: 55b5d3d0e8

* commit '55b5d3d0e887313ece26bad8ebf8f8c25ac66e3f':
InformationElementUtil TIM element parser
55b5d3d0e887313ece26bad8ebf8f8c25ac66e3f 19-Feb-2016 Glen Kuhne <kuh@google.com> Merge "InformationElementUtil TIM element parser" into mm-wireless-dev
947e55415eab3989f2f5cede0c03745cf9268309 09-Feb-2016 Glen Kuhne <kuh@google.com> InformationElementUtil TIM element parser

Added a parser to InformationElementUtil for the beacon frame Traffic
Indication Map element. Only current use for this is to get DTIM
interval for metrics.

BUG=25691077
Change-Id: I1aba8ca658e446ae5697b6d749687b0dd24f790d
rc/com/android/server/wifi/util/InformationElementUtilTest.java
5c3c06082b24f9ff0d479e82a63b52220c86598b 12-Feb-2016 Roshan Pius <rpius@google.com> WifiConfigStore: API for fetching PNO network list

Modify the existing API for retrieving PNO network list to
differentiate the list for disconnected vs connected PNO scenarios.
The network sorting orders are different for each of these PNO
scenarios. Use different comparator objects to sort the network list for
the 2 scenarios.

Also, merging the existing ePNO network class (WifiPnoNetwork) with the
supplicant based PNO network class (PnoNetworkPriority). This allows the
Connectivity manager to use a single class for all types of PNO.

While there,
Remove dead code in WifiConfigStore (buildPnoList) which was written for
ePNO.

While there,
Add back the numAssociation counter increment because we're now using
it to sort PNO list.

BUG: 27151228
Change-Id: I6d48dab367a2106eef4f1d3f396f391c57a22339
TEST: Ran unit tests
rc/com/android/server/wifi/WifiConfigStoreTest.java
1b8a2b3c8724e29ce669f5bd6b0b82250824d034 17-Feb-2016 mukesh agrawal <quiche@google.com> WifiLogger: add unit test for startLogging()

WifiLogger has no unit tests. How disappointing. :-(

It's going to take time to add a full complement of unit tests. But
let's not wait to get started.

We start by adding a unit test for startLogging(), as that method
recently had a bug.

BUG=27204661
TEST=ran tests

Change-Id: I248937dd90c35b14e95dbb4d624746eb0ebc48bd
rc/com/android/server/wifi/WifiLoggerTest.java
047aee0ba277cb512db1c22605e9b73ccfc20374 19-Feb-2016 Peter Qiu <zqiu@google.com> Merge "Add SoftApManager class" into mm-wireless-dev
am: 5aecec3422

* commit '5aecec3422a573e09b5792edd587153c00748da1':
Add SoftApManager class
5aecec3422a573e09b5792edd587153c00748da1 19-Feb-2016 Peter Qiu <zqiu@google.com> Merge "Add SoftApManager class" into mm-wireless-dev
be6cb1df0c221f72d09fc0ab6f5c45b0949c9a88 18-Feb-2016 Paul Stewart <pstew@google.com> WifiStateMachine: Only respond once to multiple EAP-SIM challenges

The commit in 5ebc35f19feab2755a13cf7d5acaeff4bbc78994 made an
attempt to fail the EAPOL process due to intermediate failures
with TelephonyManager. It's not clear how well that worked,
but it's clear from inspection that when multiple challenges
are supplied that the code then sent multiple simAuthResponse
messages -- one per challenge. This is clearly wrong.

This CL refactors the code to clearly separate the function
that generates the complete response string so it can be tested,
and leaves the handleGsmAuthRequest() method to interact with
mWifiNative in a hopefully more readable manner.

BUG: 26758602
Change-Id: Ibf8f85893e4c18195eb08114b5169dcff05dc045
TEST: New unit test for the getGsmSimAuthResponse method
rc/com/android/server/wifi/WifiStateMachineTest.java
0633c7b5996582ac2c10c5084cb11090080b07b0 19-Feb-2016 Paul Stewart <pstew@google.com> Refactor for accessor changes to WifiEnterpriseConfig [Re-Land]
am: 0fa719c770

* commit '0fa719c7706dc6e447d16543518d4ecb269b91d0':
Refactor for accessor changes to WifiEnterpriseConfig [Re-Land]
0fa719c7706dc6e447d16543518d4ecb269b91d0 16-Jan-2016 Paul Stewart <pstew@google.com> Refactor for accessor changes to WifiEnterpriseConfig [Re-Land]

WifiEnterpriseConfig has changed to provide more sane accessors.
Now, callers are not given blanket access to the internal fields
and need to pass an accessor object to either save or restore
wpa_supplicant configuration.

This CL also adds unit tests to validate the new behavior of EAP
and Phase 2 parameters to ensure that recent changes do not cause
any regressions.

Bug:26400915
Change-Id: I294d804b431e216071905b96c51e023ea424aaf5
rc/android/net/wifi/WifiEnterpriseConfigTest.java
c3b22ef2e6bbccd048e1012160b75d14353ab894 17-Feb-2016 Wei Wang <weiwa@google.com> Add test case for duplicate listeners in WifiScanner.

Bug:26663377

Change-Id: I89c7936b215251c2afb20a49de1d03184e9b4b21
rc/com/android/server/wifi/BidirectionalAsyncChannelServer.java
rc/com/android/server/wifi/WifiScannerTest.java
8f129e6c43893cddfcfb18804a543ace7fb983b3 19-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Simplify smToString using MessageUtils.
am: eed7ed0f23

* commit 'eed7ed0f235d1124564d567178e485f0a5cda616':
Simplify smToString using MessageUtils.
eed7ed0f235d1124564d567178e485f0a5cda616 17-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Simplify smToString using MessageUtils.

Change-Id: If7355bbf5295c55e97882dce55a07b607309e0f2
rc/com/android/server/wifi/WifiStateMachineTest.java
7debc76f64763f2ff91236ca0f26b2257ea29cf8 19-Feb-2016 xin He <xinhe@google.com> Merge "Fix QNS bssid blacklist update" into mm-wireless-dev
am: 9f362510e1

* commit '9f362510e1070007c54b60ebfd9fbbe312017a9a':
Fix QNS bssid blacklist update
9f362510e1070007c54b60ebfd9fbbe312017a9a 19-Feb-2016 xin He <xinhe@google.com> Merge "Fix QNS bssid blacklist update" into mm-wireless-dev
676d8394860aa8fb0ed856f41bbd0bbe2c4727fc 18-Feb-2016 Etan Cohen <etancohen@google.com> [NAN] Renamed listeners to callback per API guidelines [DO NOT MERGE]

The interfaces had multiple functions and are hence callback
and not a listener.

Note: purely a rename operation.

Bug: 27122760
Change-Id: I6dcfe1f623ee730217b52b362819abf656583003
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanServiceImplTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
8f06198cafd0e52aebe2f050af0c1a3533270888 17-Feb-2016 Etan Cohen <etancohen@google.com> [NAN]: API update - consolidate Puslish|Subscribe Data+Subscribe -> Config [DO NOT MERGE]

Simplify configuration and consolidate structures whose difference
wasn't very clear.

Bug: 27122760
Change-Id: Ib24f6217e2124c2184506f2ce1407575f5d9baaa
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanManagerTest.java
rc/com/android/server/wifi/nan/WifiNanServiceImplTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
4c618adccba43334df62ad7d2949138344c11f58 18-Feb-2016 xin He <xinhe@google.com> Fix QNS bssid blacklist update

The crash is due to delete map entries not through the
iterator's remove method when transverse the map. Removing
item will change the size of iterator and
java.util.ConcurrentModificationException will be thrown at
next iterator.next(). The correct way is to remove item through
the iterator's remove method.

BUG=27243032

Change-Id: Iede6efeafacaf8a33cce44f56e0c2b58e598e07e
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
e5b93fbfe451bc57c07b3f72191b52b6bd237d5b 09-Feb-2016 Peter Qiu <zqiu@google.com> Add SoftApManager class

The newly created class is responsible for managing soft AP
instance and tethering state transitions.

This class will be integrated to WifiStateMachine in an upcoming
CL, which will remove the existing soft AP and tethering related
code from WifiStateMachine.

Bug: 26876260
TEST=runtest frameworks-wifi

Change-Id: I25568649b8c9d18ce78019dac614bafb9c5a3448
rc/com/android/server/wifi/SoftApManagerTest.java
rc/com/android/server/wifi/TestUtil.java
rc/com/android/server/wifi/util/ApConfigUtilTest.java
c9783c72ce84ea8cc42f2c407824113019e59b11 17-Feb-2016 Etan Cohen <etancohen@google.com> NAN: Add client ID to support multiple NAN clients per UID. [DO NOT MERGE]

Allow multiple clients per UID - each with its own session namespace.
Effectively replace UID by client ID in the main state machine. The
mapping of new client IDs and their validation (as belonging to the
correct UID) is handled by the service front-end implementation.

Fix missing documentation to enable passing style checker.

Bug: 26962024
Change-Id: I963cc5940957953008035b846626dd1e8d6c82fa
rc/com/android/server/wifi/nan/WifiNanServiceImplTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
009149d90a2ba968ca23122b635f93e05517daef 18-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add final bits of required functionality for ChannelHelper" into mm-wireless-dev
am: b6e44a4ad8

* commit 'b6e44a4ad89793a9a33ed9f82f51808d62de3ad8':
Add final bits of required functionality for ChannelHelper
b6e44a4ad89793a9a33ed9f82f51808d62de3ad8 18-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add final bits of required functionality for ChannelHelper" into mm-wireless-dev
eed6bcbbe112bd907ceddf6bfe35d99d5e51934e 17-Feb-2016 xin He <xinhe@google.com> Merge "Modify BSSID blacklist behavior" into mm-wireless-dev
am: a2a3c5080b

* commit 'a2a3c5080bb6ccf6afbb8599d00b948963bfb23a':
Modify BSSID blacklist behavior
a2a3c5080bb6ccf6afbb8599d00b948963bfb23a 17-Feb-2016 xin He <xinhe@google.com> Merge "Modify BSSID blacklist behavior" into mm-wireless-dev
6ed97affc9bbce6497b6155285ba4a71196d69e1 16-Feb-2016 xinhe <xinhe@google.com> Modify BSSID blacklist behavior

The new behaviors are:
(1) If a BSSID get association rejection three times, blacklist it
(2) After 30 min of blacklist, we re-enable it again.
(3) If any connect successfully to the BSSID, re-enable it

BUG=27166673

Change-Id: I70f439b524ffc304d6c61744f90389f47006341b
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
0a8904265fc81ec1051030e66815aa191d4c347c 16-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Migrate channel/band toString to ChannelHelper" into mm-wireless-dev
am: f2d417a69e

* commit 'f2d417a69e52898d976ea01334794357ecdcfcd8':
Migrate channel/band toString to ChannelHelper
798a997d2e5bf8b3278bfeaa7ca841394e2db4b9 12-Feb-2016 Mitchell Wills <mwills@google.com> Add final bits of required functionality for ChannelHelper

Add support for getting the list of available channels for a band if
available.
Add support for estimating the duration of a scan.

Change-Id: I8abe6d857400775f72969abd4b15e8763ec772c5
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
rc/com/android/server/wifi/scanner/NoBandChannelHelperTest.java
f2d417a69e52898d976ea01334794357ecdcfcd8 16-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Migrate channel/band toString to ChannelHelper" into mm-wireless-dev
ed70643c5c1dc368b1390eed0d3c8f24b19e342f 16-Feb-2016 xin He <xinhe@google.com> Merge "add more unit test case to Quality Network Selection" into mm-wireless-dev
am: d2995af00d

* commit 'd2995af00d433ea6f952e8ff1c82c0ed2c71a274':
add more unit test case to Quality Network Selection
d2995af00d433ea6f952e8ff1c82c0ed2c71a274 16-Feb-2016 xin He <xinhe@google.com> Merge "add more unit test case to Quality Network Selection" into mm-wireless-dev
154f6abe46bab660f5a61dedc8c25157fa5b37be 16-Feb-2016 Erik Kline <ek@google.com> Use IpManager.ProvisioningRequest for IpManager#startProvisioning.
am: 00cd284ff0

* commit '00cd284ff0b4bbfd4bb39683cd2d37ef402bbc45':
Use IpManager.ProvisioningRequest for IpManager#startProvisioning.
00cd284ff0b4bbfd4bb39683cd2d37ef402bbc45 11-Feb-2016 Erik Kline <ek@google.com> Use IpManager.ProvisioningRequest for IpManager#startProvisioning.

Bug: 26991160
Change-Id: I929744e9faa3c71170a3e8e1e1bedc3c6cd16d22
rc/com/android/server/wifi/WifiStateMachineTest.java
4f945c572fd7e26cf4eecc740a2c672883b71e49 13-Feb-2016 Vinit Deshpande <vinitd@google.com> UnitTests for MOManager and AnqpCache
am: ae815bc712

* commit 'ae815bc71287f8a85727034c40bb07247a3d9415':
UnitTests for MOManager and AnqpCache
ae815bc71287f8a85727034c40bb07247a3d9415 26-Jan-2016 Vinit Deshpande <vinitd@google.com> UnitTests for MOManager and AnqpCache

MOManager is the repository that holds management
objects for Passpoint networks. This change adds tests
to add/remove and modify management objects.

AnqpCache holds results to save power; this test
verifies basic adding/querying and expiry of entries.

Change-Id: I9b12a6661f689227f7564cc6a7e0fd7e338e1e8a
ssets/r1.PerProviderSubscription.conf
ssets/r2-ttls-tree.xml
ssets/r2.PerProviderSubscription.conf
ssets/ruckus.PerProviderSubscription.conf
rc/com/android/server/wifi/AnqpCacheTest.java
rc/com/android/server/wifi/PasspointManagementObjectManagerTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
167250a118f9fb93f88a867cc7679414da4dc8b4 12-Feb-2016 xinhe <xinhe@google.com> add more unit test case to Quality Network Selection

Add more QNS unit test cases (most are for connected state)

BUG=26941880

Change-Id: I436cce2154a0cefdb9e19486b122ebe931412dee
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
18fa274d5835b6aa853cced404316157293e8fd5 12-Feb-2016 xinhe <xinhe@google.com> add Clock class for Wifi
am: ed514c84aa

* commit 'ed514c84aae008d245679f05c9dbcd7e71f126f8':
add Clock class for Wifi
ed514c84aae008d245679f05c9dbcd7e71f126f8 12-Feb-2016 xinhe <xinhe@google.com> add Clock class for Wifi

Add clock interface to wrapper the System and SystemClock
APIs. In this way we can mock it in mockito test. Integrated
with Quality Network Selection first

BUG=27166726

Change-Id: I952944ccbad32e07ba316197d1785e551e03ea21
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
17445b7996487f059114a1ab6a0efa5f95fb86be 12-Feb-2016 Bartosz Fabianowski <bartfab@google.com> resolve merge conflicts of b2f519476e to nyc-dev

Change-Id: I28da4aee94bf4f80347481da396ca40bb7d107d9
23dc88716b6fc4c15e576dacbdd5235b0f5e6552 12-Feb-2016 Paul Stewart <pstew@google.com> Merge "Revert "Refactor for accessor changes to WifiEnterpriseConfig"" into mm-wireless-dev
am: 50919ff875

* commit '50919ff8752d2b2a4617adb869047bf64e6cb34b':
Revert "Refactor for accessor changes to WifiEnterpriseConfig"
50919ff8752d2b2a4617adb869047bf64e6cb34b 12-Feb-2016 Paul Stewart <pstew@google.com> Merge "Revert "Refactor for accessor changes to WifiEnterpriseConfig"" into mm-wireless-dev
25704f0019d27c7939499721d779a1cb66537ebb 12-Feb-2016 Paul Stewart <pstew@google.com> Revert "Refactor for accessor changes to WifiEnterpriseConfig"

This reverts commit 1b0da700f6d88ab64c51cf66f2cf31cff8663fca.

Reverting until test team does their thing later today. Whoops.

Change-Id: I47716b6135fbaf1843b0f062c9374e908dc8a62e
rc/android/net/wifi/WifiEnterpriseConfigTest.java
7cc7c2dd4452e5097c83d1ff96cc31a6816e509e 12-Feb-2016 Paul Stewart <pstew@google.com> Merge "Refactor for accessor changes to WifiEnterpriseConfig" into mm-wireless-dev
am: 525af45a81

* commit '525af45a817d3e548bfbdba2af38e182bc6ec8b5':
Refactor for accessor changes to WifiEnterpriseConfig
525af45a817d3e548bfbdba2af38e182bc6ec8b5 12-Feb-2016 Paul Stewart <pstew@google.com> Merge "Refactor for accessor changes to WifiEnterpriseConfig" into mm-wireless-dev
0fb9cf43830d67894b519c9a6271320c4842a5c0 12-Feb-2016 Bartosz Fabianowski <bartfab@google.com> Allow managed profile to modify networks

If the current foreground user has a managed profile, apps running in that
profile should have the same permissions to add/remove/modify networks as
apps running as the foreground user itself.

This is a re-submit of
https://partner-android-review.googlesource.com/#/c/529950/
with updated unit tests that will also work after merging to N/master.

BUG=26867426

Change-Id: If97734abad801ae1264919c91c3ef4236469cfde
rc/com/android/server/wifi/BinderUtil.java
rc/com/android/server/wifi/BinderUtilTest.java
rc/com/android/server/wifi/ConfigurationMapTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiConfigurationTestUtil.java
rc/com/android/server/wifi/WifiConfigurationUtil.java
rc/com/android/server/wifi/WifiConfigurationUtilTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
54e2c84547e22622ba4a08bddd1c632d1d937be3 11-Feb-2016 Mitchell Wills <mwills@google.com> Migrate channel/band toString to ChannelHelper

Change-Id: Ia4ea1d29b74cd08593f13b9e74cb6f6257adf78b
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/scanner/ChannelHelperTest.java
06c07f7548feb9a4c7b53b170340447ca473ff3f 11-Feb-2016 Mitchell Wills <mwills@google.com> Update scanner onScanStatus callback to include event
am: 63539f1283

* commit '63539f1283899fbbf83ab90757961b4be51d5034':
Update scanner onScanStatus callback to include event
1b0da700f6d88ab64c51cf66f2cf31cff8663fca 16-Jan-2016 Paul Stewart <pstew@google.com> Refactor for accessor changes to WifiEnterpriseConfig

WifiEnterpriseConfig has changed to provide more sane accessors.
Now, callers are not given blanket access to the internal fields
and need to pass an accessor object to either save or restore
wpa_supplicant configuration.

This CL also adds unit tests to validate the new behavior of EAP
and Phase 2 parameters to ensure that recent changes do not cause
any regressions.

Bug:26400915
Change-Id: I575dc1688ff4b6055708e135b2692c982bc89d7a
rc/android/net/wifi/WifiEnterpriseConfigTest.java
63539f1283899fbbf83ab90757961b4be51d5034 04-Feb-2016 Mitchell Wills <mwills@google.com> Update scanner onScanStatus callback to include event

This now allows scanner implementations to indicate scan failues as
well.

This change also ensures that anqpLines is set in results from supplicant

Change-Id: Ibe18c9b804bf073b9152800295c40d072a41e641
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
10df92e35f8b7d2abb5b311dc09bf2b8ff30d206 11-Feb-2016 Mitchell Wills <mwills@google.com> Merge changes I86b5194b,Ic4150120 into mm-wireless-dev
am: 3459602371

* commit '345960237132c18a817d3aed93ab6df5906fcc97':
Add more functionality to ChannelHelper
Add scan channel helper abstraction
345960237132c18a817d3aed93ab6df5906fcc97 11-Feb-2016 Mitchell Wills <mwills@google.com> Merge changes I86b5194b,Ic4150120 into mm-wireless-dev

* changes:
Add more functionality to ChannelHelper
Add scan channel helper abstraction
edc07a7f9e7bdb34d90e7edea17a843daea4e5b0 11-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Migrate WiifConfigStoreTest to JUnit4" into mm-wireless-dev
am: 2de70392b4

* commit '2de70392b480ecf2ecf84786e49bbcf3edd1d0cd':
Migrate WiifConfigStoreTest to JUnit4
2de70392b480ecf2ecf84786e49bbcf3edd1d0cd 11-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Migrate WiifConfigStoreTest to JUnit4" into mm-wireless-dev
fa6ad93d7d4ba58e0609f8eceeadecc76cea25d1 10-Feb-2016 Mitchell Wills <mwills@google.com> Migrate WiifConfigStoreTest to JUnit4

Bug: 27049088
Change-Id: I2dfc5e383710ca7bd2f38b0ed3a4142fd254cefc
rc/com/android/server/wifi/WifiConfigStoreTest.java
8a8f89708a14547b79df1774b254f7252c64ad4d 11-Feb-2016 Mitchell Wills <mwills@google.com> resolve merge conflicts of 4086badffe to nyc-dev.

Change-Id: Idcabbfc19669aff2a99d6a39fd12a2be25dca058
4086badffeb97f4c87b2bed3fcaa49b731a6670e 11-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Revert "Allow managed profile to modify networks"" into mm-wireless-dev
9f8586ea6d640e86560efd9a2d9c1909b08a3ef4 11-Feb-2016 Mitchell Wills <mwills@google.com> Revert "Allow managed profile to modify networks"

This reverts commit bbb3149f3bc301e81c202438b77c45574a90a851.

Bug: 27145628
Change-Id: I05ac9c714373b98fa73e0dba21ec4d815200af75
rc/com/android/server/wifi/BinderUtil.java
rc/com/android/server/wifi/BinderUtilTest.java
rc/com/android/server/wifi/ConfigurationMapTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiConfigurationTestUtil.java
rc/com/android/server/wifi/WifiConfigurationUtil.java
rc/com/android/server/wifi/WifiConfigurationUtilTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
f5b4bcf6af1dd024e7219ca69fd54f20948c0be9 11-Feb-2016 Glen Kuhne <kuh@google.com> Merge "WifiMetrics ConnectionEvent logging" into mm-wireless-dev
am: 6eb121431c

* commit '6eb121431c67b98d8b14242a34c28b205a42b119':
WifiMetrics ConnectionEvent logging
6eb121431c67b98d8b14242a34c28b205a42b119 11-Feb-2016 Glen Kuhne <kuh@google.com> Merge "WifiMetrics ConnectionEvent logging" into mm-wireless-dev
3e024d7ca0520bd167eac44c1745183919748c83 11-Feb-2016 Bartosz Fabianowski <bartfab@google.com> resolve merge conflicts of bbb3149f3b to nyc-dev

Change-Id: I29effba14b5e3bcff4c996e1e12b07f1d7143850
bbb3149f3bc301e81c202438b77c45574a90a851 11-Feb-2016 Bartosz Fabianowski <bartfab@google.com> Allow managed profile to modify networks

If the current foreground user has a managed profile, apps running in that
profile should have the same permissions to add/remove/modify networks as
apps running as the foreground user itself.

BUG:26867426

Change-Id: I6ab891625b673e617e1c38863b9c6e71e4938a0b
rc/com/android/server/wifi/BinderUtil.java
rc/com/android/server/wifi/BinderUtilTest.java
rc/com/android/server/wifi/ConfigurationMapTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiConfigurationTestUtil.java
rc/com/android/server/wifi/WifiConfigurationUtil.java
rc/com/android/server/wifi/WifiConfigurationUtilTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
4326ff75bfc8dbe3081402df4f568584ab61b9d7 11-Feb-2016 Roshan Pius <rpius@google.com> Merge "Update network priorities before PNO is triggered" into mm-wireless-dev
am: bfcea7de75

* commit 'bfcea7de75875c900de19a8504416492ed96ae21':
Update network priorities before PNO is triggered
bfcea7de75875c900de19a8504416492ed96ae21 11-Feb-2016 Roshan Pius <rpius@google.com> Merge "Update network priorities before PNO is triggered" into mm-wireless-dev
2532a24b254d724a9b6771d327dc410b32b18602 05-Feb-2016 Glen Kuhne <kuh@google.com> WifiMetrics ConnectionEvent logging

Reworked ConnectionEvent start and end calls within StateMachine to
produce a more correct log of ConnectionEvents (previously these calls
produced an incorrect placeholder log).
Some ConnectionEvents being triggered by CMD_AUTO_CONNECT are still not
being ended due to double CMD_AUTO_CONNECT calls.
Modified the behaviour of endConnectionEvent(), this will not create or
modify ConnectionEvents if there is no currentConnectionEvent.

BUG=25691077

Change-Id: I932b50cef5d6d66a7dc22f8c118fe9c140a5f4ba
rc/com/android/server/wifi/WifiMetricsTest.java
39175cc807488dd849e2c530f8be30dd674fbd9f 09-Feb-2016 Mitchell Wills <mwills@google.com> Add more functionality to ChannelHelper

Check if a channel is in a ScanSettings
Add channels to accumulator from native settings
Add unit tests for non-abstract ChannelHelper methods

Change-Id: I86b5194b2a5c852fd25041a363f42caa202dfa7a
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/scanner/ChannelHelperTest.java
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
rc/com/android/server/wifi/scanner/NoBandChannelHelperTest.java
0e03fa9a1ac57d1eca2b5f5d6880b655d67e2508 11-Feb-2016 Erik Kline <ek@google.com> Merge "Split updateLinkProperties() and provisioning change handling" into mm-wireless-dev
am: d150184a5b

* commit 'd150184a5b28f862b39ad383ab87ee0ac4ca6be8':
Split updateLinkProperties() and provisioning change handling
d150184a5b28f862b39ad383ab87ee0ac4ca6be8 10-Feb-2016 Erik Kline <ek@google.com> Merge "Split updateLinkProperties() and provisioning change handling" into mm-wireless-dev
ac9ad3283508db15b65b1cbb89b841278973276b 28-Jan-2016 Roshan Pius <rpius@google.com> Update network priorities before PNO is triggered

The max SSID watch list size for PNO supported by wlan drivers is fixed
to a certain size. wpa_supplicant sorts this SSID watch list based on
the priorities assigned to those networks. This may result in us losing
some frequently used networks from the PNO list because they have lower
priorities. This is a side effect of how we assign priorities to
network configuration as they're added.
So before we trigger PNO, re-sort the network list based on the
'numAssociation' value and assign them relative priorities. This will make
sure that the PNO SSID watch list contains all the frequent SSID's to
which we were connected to.
PS: This change has a side-effect of ignoring the configured priorities
during PNO.

While there,
1. Add a common test utils class for common utility functions for all
tests.
2. Annotate all tests in WifiConfigStore so that
|WifiTestUtil.getTestMethod| works reliably.

BUG: 26763375
Change-Id: I2c82254b2cb83aef0dd4da9e7d9b2eb5b376bead
TEST: `adb shell am instrument -e class
'com.android.server.wifi.WifiConfigStoreTest' -w
'com.android.server.wifi.test/android.support.test.runner.AndroidJUnitRunner'`
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
rc/com/android/server/wifi/WifiTestUtil.java
b30f36a05e8867c209a3d6fd1de84af69a627053 10-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Remove unused supplicant scan with connection setup option" into mm-wireless-dev
am: 28d387c8fa

* commit '28d387c8fa63967072dc7c1be46b8aa00f754a17':
Remove unused supplicant scan with connection setup option
8cf2b5c507918a30629b9dc24944422fc0920665 03-Feb-2016 Erik Kline <ek@google.com> Split updateLinkProperties() and provisioning change handling

Bug: 26991160
Change-Id: I20a41e5f1426befc474e923d2763b508f26f1ce4
rc/com/android/server/wifi/WifiStateMachineTest.java
ed6a985c7b63e295248fa7e8292c99b48b7a4283 04-Feb-2016 Mitchell Wills <mwills@google.com> Remove unused supplicant scan with connection setup option

We no longer want supplicant to make connection decisions by itself so
remove the option since it is dead code.

Change-Id: I53a059219e0080e4780d9a131748958049b47df2
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
7538f4c7a132a5015dee8b4563bb5ea5cd3f0a13 09-Feb-2016 Randy Pan <zpan@google.com> Merge "Build \'capabilities\' string for gscan results" into mm-wireless-dev
am: aab5468666

* commit 'aab54686664ce47f2c41614a8460f454743d157d':
Build 'capabilities' string for gscan results
9afe16e3fdd84fa9df49bef6e8c5d327ac228f63 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Remove generic type argument from AnswerWithArguments" into mm-wireless-dev
am: 27df8bc929

* commit '27df8bc929b7444414fb8916b72a21c5d7ea5be8':
Remove generic type argument from AnswerWithArguments
aab54686664ce47f2c41614a8460f454743d157d 09-Feb-2016 Randy Pan <zpan@google.com> Merge "Build 'capabilities' string for gscan results" into mm-wireless-dev
3571366ac36c70746b9f013ec2b54482861c9292 03-Feb-2016 Randy Pan <zpan@google.com> Build 'capabilities' string for gscan results

Populate the WiFi beacon capability information from gscan to
WifiNative. Build ScanResult 'capabilities' string based on this
value and the information elements.

Add unit tests.

Bug: 26908033
Bug: 26908558
Change-Id: I661bb501a09d3e79ee0b0a8e141e7e47c72687f7
rc/com/android/server/wifi/util/InformationElementUtilTest.java
27df8bc929b7444414fb8916b72a21c5d7ea5be8 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Remove generic type argument from AnswerWithArguments" into mm-wireless-dev
64f4132028dc9878cd7e13d3258910f2f672bf19 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add a section on debugging tests to the test readme" into mm-wireless-dev
am: f7dd706b60

* commit 'f7dd706b60d5658d0244cd87ffc3474ed9584034':
Add a section on debugging tests to the test readme
79d691a718a3b8980f99940cbeae8d434c469858 09-Feb-2016 Mitchell Wills <mwills@google.com> Remove generic type argument from AnswerWithArguments

It does not add any type safety and was wrong in a number of usages.

Change-Id: I93a76ff60f8dd2fc5eb9786bc312f96f9cfdeaaa
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/MockAnswerUtil.java
rc/com/android/server/wifi/MockWifiMonitor.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
f7dd706b60d5658d0244cd87ffc3474ed9584034 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add a section on debugging tests to the test readme" into mm-wireless-dev
9e06c302626204c7b46e0025a6f91888be5607ef 09-Feb-2016 xin He <xinhe@google.com> Merge "add more unit test case to Quality Network Selection" into mm-wireless-dev
am: 84c11d63f2

* commit '84c11d63f274ec136a94e0f17982eba1e07f1d9e':
add more unit test case to Quality Network Selection
84c11d63f274ec136a94e0f17982eba1e07f1d9e 09-Feb-2016 xin He <xinhe@google.com> Merge "add more unit test case to Quality Network Selection" into mm-wireless-dev
2bc580c67c614c2b7eeaf88a7795620fc53a8099 09-Feb-2016 Jan Nordqvist <jannq@google.com> Merge "Removing Hotspot 2.0 OSU client code from framework." into mm-wireless-dev
am: 676d664bf4

* commit '676d664bf4b5f59279a53a986ce94363e2bc4fd2':
Removing Hotspot 2.0 OSU client code from framework.
676d664bf4b5f59279a53a986ce94363e2bc4fd2 09-Feb-2016 Jan Nordqvist <jannq@google.com> Merge "Removing Hotspot 2.0 OSU client code from framework." into mm-wireless-dev
712ef6246834caeac3d5b06bea08e85d6b29cd7a 05-Feb-2016 Mitchell Wills <mwills@google.com> Add scan channel helper abstraction

This will allow code to easily function without worrying about the
differences in the amount of information known about scan channels.

Currently this abstraction will only support merging channels, but more
functionality will be added as needed. Eventually this will replace all
functionality in WifiChannelHelper.

Change-Id: Ic41501204fa4ff4470491055f4204ad9a88000d4
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/scanner/KnownBandsChannelHelperTest.java
rc/com/android/server/wifi/scanner/NoBandChannelHelperTest.java
a08566d83c94ad608dd25f86fa7cc82d78734508 09-Feb-2016 Wei Wang <weiwa@google.com> Enable Rtt Responder Role(2/4).
am: 68cb8c02b4

* commit '68cb8c02b4ad079c54a2ffd4407da921d18c7af9':
Enable Rtt Responder Role(2/4).
68cb8c02b4ad079c54a2ffd4407da921d18c7af9 25-Jan-2016 Wei Wang <weiwa@google.com> Enable Rtt Responder Role(2/4).

Change-Id: Ib18af94fbba21c833c47336f7a92afe918dc9a89
rc/com/android/server/wifi/RttServiceTest.java
rc/com/android/server/wifi/TestUtil.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
21524058ffc735089b1777526df6c9f9dd37ff0e 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add ScanDetailUtil to convert ScanResult to ScanDetail" into mm-wireless-dev
am: 5f38b29b5f

* commit '5f38b29b5f4b891e59e8c20b210fa9e0e0a28440':
Add ScanDetailUtil to convert ScanResult to ScanDetail
5f38b29b5f4b891e59e8c20b210fa9e0e0a28440 09-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Add ScanDetailUtil to convert ScanResult to ScanDetail" into mm-wireless-dev
9edf315919914488caa581bef1bfeb78d812deca 08-Feb-2016 Mitchell Wills <mwills@google.com> Do some cleanup of WifiScanningServiceTest
am: d2d3de4c2b

* commit 'd2d3de4c2bea4b949ed78a9b01b920bffa7e51a9':
Do some cleanup of WifiScanningServiceTest
c83c0526b1c209ca9d831154a13c4ef9131b17f8 05-Feb-2016 xinhe <xinhe@google.com> add more unit test case to Quality Network Selection

Add more QNS test cases when deivice is under disconnected
state. Add a clear method in QNS for test purpose

BUG=26941880

Change-Id: Icf03dc71b1fab5b65b528e6fed4eb5f918f06e36
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
d2d3de4c2bea4b949ed78a9b01b920bffa7e51a9 07-Feb-2016 Mitchell Wills <mwills@google.com> Do some cleanup of WifiScanningServiceTest

Improve the error messages generated by tests and make utilities more
general in preparation for adding single scan tests. Also do some
general scan test cleanup.

Change-Id: Iff292a9bd3519c1f2819c8ca4d3ecbfa87ab80f5
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
e4e3b8cb884dd9e754a437ea6feac502191f1767 07-Feb-2016 Mitchell Wills <mwills@google.com> Add ScanDetailUtil to convert ScanResult to ScanDetail

Also move InformationElementUtilTest to util package

Change-Id: I4a2c6a561ce6106d7c8c671cec225cf5ae6532f0
rc/com/android/server/wifi/InformationElementUtilTest.java
rc/com/android/server/wifi/util/InformationElementUtilTest.java
rc/com/android/server/wifi/util/ScanDetailUtilTest.java
70d4f1ec322e3c6a888092380f4d3036c062cdb3 06-Feb-2016 Mitchell Wills <mwills@google.com> Add a section on debugging tests to the test readme

Also cleanup/improve a few other sections

Change-Id: I38ef236be9bea93b091968081ba371b9c291f3c3
EADME.md
1b9c2436f0a03d8b5725cf521b0cf8248e85d228 05-Feb-2016 Etan Cohen <etancohen@google.com> NAN: Add NAN HAL capability
am: e36f5903f5

* commit 'e36f5903f5d236a29dc94c8bdb215807ae75f5a1':
NAN: Add NAN HAL capability
72401daf8411fb8e56ee0dd4ecb27cd3bba29e33 05-Feb-2016 Etan Cohen <etancohen@google.com> Merge "NAN: Adding tests for internal state of WifiNanStateManager" into mm-wireless-dev
am: a40a871604

* commit 'a40a871604177637c12f190cbbfbf71752c490bd':
NAN: Adding tests for internal state of WifiNanStateManager
e36f5903f5d236a29dc94c8bdb215807ae75f5a1 03-Feb-2016 Etan Cohen <etancohen@google.com> NAN: Add NAN HAL capability

Query NAN HAL for its capabilities and propagate to WifiNanStateManager for
storage (usage is TBD).

BUG=26564631
Change-Id: Icb4223c5a03cb65fba1781d0ebe78d70110d3a86
ni/wifi_hal_mock.h
ni/wifi_nan_hal_mock.cpp
rc/com/android/server/wifi/nan/WifiNanHalMock.java
rc/com/android/server/wifi/nan/WifiNanHalTest.java
22b4156d2948e3108ae8439dc72f76fb97526ace 26-Jan-2016 Etan Cohen <etancohen@google.com> NAN: Adding tests for internal state of WifiNanStateManager

Add tests for internal state of WifiNanStateManager: validate that
cleanup of client (UID) and session registrations (pending transactions)
done when client disconnected or when a session is destroyed.

While usually not a good idea to test internal state (all other tests
are focused on external contract of class) in this case the results would
be memory leak and information leak.

Fixed several errors discovered with new unit tests.

Bug: 26878060
Bug: 26880665
Change-Id: I89f20353c296edb562de3cb0dfdc208e91624acf
ni/wifi_hal_mock.cpp
rc/com/android/server/wifi/HalMockUtils.java
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanManagerTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
3fff4c9bd5db730141e75706a7229814d403b363 05-Feb-2016 Jan Nordqvist <jannq@google.com> Removing Hotspot 2.0 OSU client code from framework.

Change-Id: I1be652aeb60cc3c49b606e4e2f467951cf2d68b5
rc/com/android/server/wifi/WifiStateMachineTest.java
136bd86c2653e31b2a26d93a3c4a0e2df76b41bc 04-Feb-2016 xin He <xinhe@google.com> Merge "fix the broken network selection BSSID disable / enable" into mm-wireless-dev
am: ddc9e6bd99

* commit 'ddc9e6bd99cf28b4b7304672b7ecc1ead9cdd0b4':
fix the broken network selection BSSID disable / enable
ddc9e6bd99cf28b4b7304672b7ecc1ead9cdd0b4 04-Feb-2016 xin He <xinhe@google.com> Merge "fix the broken network selection BSSID disable / enable" into mm-wireless-dev
76e9e2a18840cc17747103c86b5b9323d059ef18 03-Feb-2016 Jan Nordqvist <jannq@google.com> Merge "New System APIs for Passpoint r2 app." into mm-wireless-dev
am: 92ce793e9a

* commit '92ce793e9af3faf5d996dd1e592fbc728785058a':
New System APIs for Passpoint r2 app.
92ce793e9af3faf5d996dd1e592fbc728785058a 03-Feb-2016 Jan Nordqvist <jannq@google.com> Merge "New System APIs for Passpoint r2 app." into mm-wireless-dev
2e814680f4dd27a5f825afab189843582235cedc 24-Jan-2016 Jan Nordqvist <jannq@google.com> New System APIs for Passpoint r2 app.

Change-Id: If23e6ab432e871a407cbff94292673524c6d72bd
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
7b6cd1fce7850fc2aa0e510b170e6fd509308d21 02-Feb-2016 xinhe <xinhe@google.com> fix the broken network selection BSSID disable / enable

In this bug, AP try to steer the STA from 2.4GHz to 5GHz
band. Thus, the 2.4GHz BSSID reject the association request.
In theory, framework should disable this bssid for future
connection. However, this is broken. This CL fix the broken
network selection BSSID disable/enable

BUG=26916700

Change-Id: Ib358dd5a8481c4785391345df33b08459f781b81
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
6094859a6bb7a6e24e7d0eea78975c52eb071e41 03-Feb-2016 Erik Kline <ek@google.com> resolve merge conflicts of 8013a9b653 to master.

Change-Id: I327bc86b770c516a4357633d1b5929f89e097738
8013a9b65375608d80606780e9e1b313576a0f80 02-Feb-2016 Erik Kline <ek@google.com> Move DHCPv4 mechanics out to IpManager

Bug: 17345682
Change-Id: Iafe64e924b15c60e27e71c625439f3ab3d251c69
rc/com/android/server/wifi/WifiStateMachineTest.java
3350cbe20cc4f04f96d87a93376ba44cc00bfba7 02-Feb-2016 Peter Qiu <zqiu@google.com> Merge "WifiApConfigStore refactoring" into mm-wireless-dev
am: a51955bb18

* commit 'a51955bb18c047b2d7e4160f75b7e2dc876eb227':
WifiApConfigStore refactoring
a51955bb18c047b2d7e4160f75b7e2dc876eb227 02-Feb-2016 Peter Qiu <zqiu@google.com> Merge "WifiApConfigStore refactoring" into mm-wireless-dev
99501298a44a63049b47908c153290ead28709df 02-Feb-2016 xin He <xinhe@google.com> Merge "decouple Quality Network Selection with WifiStateMachine" into mm-wireless-dev
am: 2e484f49a0

* commit '2e484f49a044c3d25da845e544c81b2bacfce714':
decouple Quality Network Selection with WifiStateMachine
2e484f49a044c3d25da845e544c81b2bacfce714 02-Feb-2016 xin He <xinhe@google.com> Merge "decouple Quality Network Selection with WifiStateMachine" into mm-wireless-dev
00350909989434fe20c2cf8f4fefbce60f4ed61a 02-Feb-2016 Erik Kline <ek@google.com> Move static IP configuration into IpManager
am: 6728555d8e

* commit '6728555d8e533b3ae2efe7e48f4a0bac3809d959':
Move static IP configuration into IpManager
6728555d8e533b3ae2efe7e48f4a0bac3809d959 01-Feb-2016 Erik Kline <ek@google.com> Move static IP configuration into IpManager

Also, stop passing around "reason" for IPv4 provisioning success
or failure.

Bug: 17345682
Change-Id: Ib7f2e1ba7ce5d8c17427e21ad9035b06750d2452
rc/com/android/server/wifi/WifiStateMachineTest.java
b7e25b4194b602300b9fc62c22f528bf5e668faf 02-Feb-2016 Pankaj Kanwar <pkanwar@google.com> Merge "Add DhcpFailure and BadNetworkEvent tests to WifiStateMachine" into mm-wireless-dev
am: bade25ebb7

* commit 'bade25ebb7b4137521576ba01e77adbda382ac11':
Add DhcpFailure and BadNetworkEvent tests to WifiStateMachine
bade25ebb7b4137521576ba01e77adbda382ac11 02-Feb-2016 Pankaj Kanwar <pkanwar@google.com> Merge "Add DhcpFailure and BadNetworkEvent tests to WifiStateMachine" into mm-wireless-dev
abcc229a23f7f0754bac999c7944e8ea4b4c3253 01-Feb-2016 Arthur Hsu <arthurhsu@google.com> Merge "Follow up of ag/848030."
142f2a85c48847ff0b15d71490b8465df0841492 01-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Revert "Refactor WifiScanner support for oneshot scans"" into mm-wireless-dev
am: aed8c07f8d

* commit 'aed8c07f8dc09da9450eae81f4fa8c63191894e0':
Revert "Refactor WifiScanner support for oneshot scans"
aed8c07f8dc09da9450eae81f4fa8c63191894e0 01-Feb-2016 Mitchell Wills <mwills@google.com> Merge "Revert "Refactor WifiScanner support for oneshot scans"" into mm-wireless-dev
3fdceeaa74e21c0ca4da52deeeef6571e7e2a6cd 01-Feb-2016 Mitchell Wills <mwills@google.com> Revert "Refactor WifiScanner support for oneshot scans"

This CL does not correctly handle devices that do not support WifiNative.getChannelsForBand

Bug: 26895774

This reverts commit 772124d1f1ddb2b9537de5efc748943808dafe80.

Change-Id: Ie49715fc89750f79c8e5f188cb42094f1076a48b
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
b96deebb3e7ce2587fef3cab0049c703d0623c24 30-Jan-2016 xinhe <xinhe@google.com> decouple Quality Network Selection with WifiStateMachine

Currently, Quality Network Selection grab a reference to
WifiStateMachine and need directly call some APIs in
WifiStateMachine. We'd like to reduce the coupling
between Quality Network Selection and WifiStateMachine
for better stronger self-containing. This can increase
the robust and test-ability.

BUG=26875232

Change-Id: Ib4e02a2d5b29bade22c416540c38d39dfee2c302
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
c94a64a292925a00c33413c81a46941093495b3e 24-Jan-2016 pkanwar <pkanwar@google.com> Add DhcpFailure and BadNetworkEvent tests to WifiStateMachine

This CL adds 2 tests for WifiStateMachine:

- TestDhcpFailure tests failure in dhcp client.
- TestBadNetworkEvent tests sending the NETWORK_DISCONNECTION_EVENT
during connection to make sure that the state machine does not break.

BUG=26901681

Change-Id: I9e79d8a07d18f397a38816e0a508d13482143937
rc/com/android/server/wifi/WifiStateMachineTest.java
683b98d17bfa71701eea245f334bd83d9cfa6e01 01-Feb-2016 Erik Kline <ek@google.com> resolve merge conflicts of 9bd76b7c0a to master.

Change-Id: Ia89f7d00b8a1d5d4f0c71bdc0ab3912dab9b4e41
9bd76b7c0afc90d800066397497b5947916b90fa 13-Jan-2016 Erik Kline <ek@google.com> Initial refactoring to migrate IP-related things to IpManager

Bug: 17345682
Change-Id: I2cdd59a4ed405b49dd1e5c4f382f6515705b5261
rc/com/android/server/wifi/WifiStateMachineTest.java
3a24f36a730316a194c79e87963f3b19e3b1e1e4 30-Jan-2016 Arthur Hsu <arthurhsu@google.com> Follow up of ag/848030.

Address reviewer comments and make linter happy.

Change-Id: Iba9738275038ad2dfb0f40c5112b2d6a762cb333
rc/com/android/server/wifi/WifiCertManagerTest.java
c79666b79e273ceaa2f74090b02ca6cf83c61387 27-Jan-2016 Peter Qiu <zqiu@google.com> WifiApConfigStore refactoring

Here are main changes to WifiApConfigStore:
- add public APIs to get/set AP configurations, instead of doing it
via message passing between state machines.
- remove unnecessary statemachine logics.
- remove the use of a dedicated thread for writing configuration file,
the reason is that the file size is fairly small, seems unnecessary to
create a separate thread just for that (which adds complexity).
- handle setting of "null" ap configuration, by falling back to use
the default configuration.
- add unit tests

With this refactoring, WifiApConfigStore becomes more self-contained,
which can be easily reused by other modules (e.g. upcoming SoftApManager).

Bug: 26727266
TEST=runtest frameworks-wifi
TEST=manual test: update/enable WiFi hotspot

Change-Id: If438d5be7eaf59f0f2d35ed25a899cef93c5a638
rc/com/android/server/wifi/WifiApConfigStoreTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
d24bd60cc49acfabd6eb47ca77ad6af02b1082b1 30-Jan-2016 Mitchell Wills <mwills@google.com> Merge "Refactor WifiScanner support for oneshot scans" into mm-wireless-dev
am: 6788fcec7c

* commit '6788fcec7c1f46563aaf30e8cc1e8e7cb7773c60':
Refactor WifiScanner support for oneshot scans
6788fcec7c1f46563aaf30e8cc1e8e7cb7773c60 30-Jan-2016 Mitchell Wills <mwills@google.com> Merge "Refactor WifiScanner support for oneshot scans" into mm-wireless-dev
772124d1f1ddb2b9537de5efc748943808dafe80 04-Nov-2015 Mitchell Wills <mwills@google.com> Refactor WifiScanner support for oneshot scans

Seperate oneshot scans so they are no longer implemented using
background scans and make WifiStateMachine use WifiScanner for single
scans.

This changes requires a few parts:
1. Implement single scan logic in WifiScanningServiceImpl for merging
and executing scan requests using the single scan native interface.
2. Writing tests for the new code in 1
3. Make supplicant start scans by using WifiScanner and when it
recieves callbacks dispatch scan complete/failure messages.
4. Enable HalWifiScannerImpl and SupplicantWifiScannerImpl to listen to
supplicant scan events now that WifiStateMachine does not.

Bug: 26525037
Change-Id: Iddd6d64b35fed129048e1fd5c79acb6982bfc418
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
a43ca810bea25734a8ad1a8ced14991ceb04272b 29-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Merge "Handle user switch in WifiStateMachine.DefaultState" into mm-wireless-dev
am: 9feb86132e

* commit '9feb86132e4613603f8c1ed649001014c8059969':
Handle user switch in WifiStateMachine.DefaultState
9feb86132e4613603f8c1ed649001014c8059969 29-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Merge "Handle user switch in WifiStateMachine.DefaultState" into mm-wireless-dev
04e2e800da7fc759fb2f7b54df02d9f7ea6ae4e8 28-Jan-2016 Etan Cohen <etancohen@google.com> Merge "NAN: add message ID to correlate message callbacks to original message" into mm-wireless-dev
am: d3efa09daa

* commit 'd3efa09daa49ad39ed1f6920388e9ba63c8e271b':
NAN: add message ID to correlate message callbacks to original message
d3efa09daa49ad39ed1f6920388e9ba63c8e271b 28-Jan-2016 Etan Cohen <etancohen@google.com> Merge "NAN: add message ID to correlate message callbacks to original message" into mm-wireless-dev
f2a63d82102461f1e6dbcef7ba16625bc07940ff 28-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Handle user switch in WifiStateMachine.DefaultState

The WiFiStateMachine should take not of changes to the foreground user
regardless of its current internal state. The handling of the user
switch message should therefore be implemented in the DefaultState,
which all other states are built on top of.

BUG: 26846176

Change-Id: Ie605f4df3625e445d2015797c3e9bf57615c1f4d
rc/com/android/server/wifi/WifiStateMachineTest.java
b8301188fa59121d6850d4989ad3342720d133fa 28-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Merge "Test that WifiConfigStore handles duplicate configurations correctly" into mm-wireless-dev
am: 8541f64110

* commit '8541f6411048c5c6281699153b8c7c73e1f30c4c':
Test that WifiConfigStore handles duplicate configurations correctly
8541f6411048c5c6281699153b8c7c73e1f30c4c 28-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Merge "Test that WifiConfigStore handles duplicate configurations correctly" into mm-wireless-dev
fcc5bc85293213868da5830e01c26363ee2e2cb1 28-Jan-2016 xin He <xinhe@google.com> Merge "Remodel Network Selection" into mm-wireless-dev
am: 2c990df82a

* commit '2c990df82a9e01a29b4cbe682226b22b805f527f':
Remodel Network Selection
2c990df82a9e01a29b4cbe682226b22b805f527f 28-Jan-2016 xin He <xinhe@google.com> Merge "Remodel Network Selection" into mm-wireless-dev
b50356194ccfdaf5e127d9f705f99713d6f1e98c 26-Jan-2016 xinhe <xinhe@google.com> Remodel Network Selection

There are two main changes in this CL:
(1) Add user selection preference support. If user
explicitly chooses a network, framework will remember
it and consider user has a higher preference of this
network over all other visible networks.

(2) Seperate user set BSSID and framework chosen BSSID.
The BSSID under WifiConfiguration is set by user and is
not allowed to be overrided. The BSSID under Network
selection status is the best BSSID chosen by the
framework to associate with.

BUG=26012244
BUG=26721725

Change-Id: I3cfb7db870c6abe933a296267bc1909b4810c8f8
rc/com/android/server/wifi/WifiConfigurationUtil.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
a8f4fbe984b2ee4a10a98d71f61bbb7c3065c5f2 27-Jan-2016 Glen Kuhne <kuh@google.com> Merge "WifiMetric shorter proto dump" into mm-wireless-dev
am: b8bf980e58

* commit 'b8bf980e5827fb97d1b3ad5debcea74d5ad8db8b':
WifiMetric shorter proto dump
11638f348ba45f9f417928e79b81186cef76c561 27-Jan-2016 Glen Kuhne <kuh@google.com> WifiMetric shorter proto dump

Before, proto was dumped as part of the standard Wifi dump using:
'dumpsys wifi proto'
Now, proto is dumped on its own using:
'dumpsys wifi wifiMetricsProto'
This reduces dump size significantly. The old dumpsys argument is no
longer used to dump the proto.

BUG=25691077

Change-Id: I7c7d09b906b11af7842d07fc719bf52dca9ba438
rc/com/android/server/wifi/WifiMetricsTest.java
2e09c384f5ce86061b115f20fe3ca75a175d87f0 26-Jan-2016 Etan Cohen <etancohen@google.com> NAN: add message ID to correlate message callbacks to original message

Add message ID to be specified by caller to each message. Same message ID
is provided back in callbacks indicating message send success or failure.

Message ID is purely used as a caller-side object - the service doesn't use
the contents in any way.

Bug: 26769293
Change-Id: Ib1243f42473ecbd616a6c620d2fff4aa9d3a0d73
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
58ca3b3efbe38a3a13bba21ee312a610616fa57c 27-Jan-2016 Rubin Xu <rubinxu@google.com> Merge "Support multiple CA certificates for EAP network" into mm-wireless-dev
am: fbda49b838

* commit 'fbda49b838947610deb378d501c686965fef134e':
Support multiple CA certificates for EAP network
266600869bd02f51c8351e01a9e415af8257f259 26-Jan-2016 Arthur Hsu <arthurhsu@google.com> Merge "WifiCertManager implementation."
d39cacb7a5ae9150b3a68b097614c5be697e5751 26-Jan-2016 Mitchell Wills <mwills@google.com> Add new liblzma to wifi tests APK

The liblzma library is now required to load the HAL native library due
to an indirect dependancy from libutils.

Change-Id: Ifa9f533b6a902b4b078763e5b2ee22a72a4b2268
ndroid.mk
75a766bae85ee8e94fbaad8fb5214804e7ff97e4 26-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Test that WifiConfigStore handles duplicate configurations correctly

When loading network configurations from the wpa_supplicant, the
WifiConfigStore may encounter duplicate entries caused by WPS. This CL
adds a test which verifies that the WifiConfigStore handles such
duplicates correctly (by having the second configuraiton overwrite the
first)

BUG:25600871
Change-Id: Iec8fd9a6dc04849192a0761a9d26a0aacd401c0b
rc/com/android/server/wifi/WifiConfigStoreTest.java
78463be32c01259841f4c0b670b742c3c2040cf3 29-Nov-2015 Rubin Xu <rubinxu@google.com> Support multiple CA certificates for EAP network

Copy all configured CA certificates to key store and set up their aliases
when adding networks. Remove all certificates when the network is removed.

Bug: 22547958
Change-Id: I91836911bfc84ec2922c5db4e9019a2872f361f0
rc/android/net/wifi/FakeKeys.java
rc/android/net/wifi/WifiEnterpriseConfigTest.java
rc/com/android/server/wifi/MockKeyStore.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
2bfc67c9893c0a525b224d68dd73a74212b0c29f 20-Jan-2016 Arthur Hsu <arthurhsu@google.com> WifiCertManager implementation.

The WiFiCertManager is essentially a wrapper around the KeyStore that
filters out client certs (and their corresponding private keys) that the
current user should not see.

Change-Id: I1843114c54cb459ceec3d3546055b91f6b177125
rc/com/android/server/wifi/WifiCertManagerTest.java
bcdabb1fa1894fcca610692ec94459fe623afa74 22-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Implement private network configurations in WifiService

* Make ConfigurationMap aware of the current foreground user. Suffix each
accessor with one of:
- ForCurrentUser() (operates on network configurations visible to the
current user only)
- ForAllUsers() (operates on all network configurations)
* Make WifiConfigStore aware of the current foreground user:
- Whenever the user changes, networks that are no longer visible are
disabled and networks that newly became visible are enabled.
- Account for the fact that the configKey cannot be computed from
information stored in wpa_supplicant.conf alone while loading
network configurations from disk.
- Have all public methods that add/remove/modify network configurations
operate on configurations visible to the current foreground user only.

BUG=25600871

Change-Id: Id1e81dd649ac5253c94e65b6a25e239fc3cf09a4
rc/com/android/server/wifi/ConfigurationMapTest.java
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiConfigurationUtil.java
daf5292779d8a24d02f8ec51f51b061b535ed667 21-Jan-2016 Mitchell Wills <mwills@google.com> Merge "Add some tests for WifiScanningService" into mm-wireless-dev
94bd575cb4766ed0dfbaad0fc7719a9e9e85a260 15-Jan-2016 Mitchell Wills <mwills@google.com> Add some tests for WifiScanningService

Cleanup WifiScanningServiceImpl a little and add a few basic tests
Also cleaned up some tests and added some more utilities

Change-Id: Ic0ac34344de6cf8fa03b741189156916ae35e2a3
EADME.md
rc/com/android/server/wifi/BidirectionalAsyncChannel.java
rc/com/android/server/wifi/ExampleWifiTest.java
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/MockAnswerUtil.java
rc/com/android/server/wifi/MockWifiMonitor.java
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
rc/com/android/server/wifi/WifiScanningServiceTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
996ff6b8a9d5a75ef41ad4d1efccb04a915ea2c3 21-Jan-2016 Glen Kuhne <kuh@google.com> Merge "Wifi Metrics, Initial Commit" into mm-wireless-dev
1b067831bbff14f8e7a99b927b69f714d1b03448 04-Jan-2016 Glen Kuhne <kuh@google.com> Wifi Metrics, Initial Commit

Created WifiMetrics class to log wireless metrics.
Dumps Metrics as Base64 wifi.proto, with dumpsys option 'proto'.
Implements SOME metric collection from wifi service

Bug: 25691077
Change-Id: I28a745b5f66dd1d38868b7eadd79882fd2c5c5a2
rc/com/android/server/wifi/WifiMetricsTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
a04138fa633a02ed992e1a38decb0eb9a81430e2 20-Jan-2016 Randy Pan <zpan@google.com> Merge "Optimize WiFi scanner predefined bucket settings" into mm-wireless-dev
78c66a6fa8ac2f6c9d3fa74313a4ac8c3585cb18 16-Jan-2016 Randy Pan <zpan@google.com> Optimize WiFi scanner predefined bucket settings

Configure the predefined period values to be PERIOD_MIN_GCD_MS
* 2^N. This helps power saving and cpu utilization.

Updated the scanner unit tests.

Bug: 26588661
Change-Id: I6f62fd8072086843506c9b624c67f959fcdc4ecb
rc/com/android/server/wifi/MultiClientSchedulerTest.java
c84802f3c6026f42cd39575d7cf23972ad9fe375 15-Jan-2016 xinhe <xinhe@google.com> Broken Network Selection Tests

StateMachine.sendMessage is final and can not
be mocked. Use other mothod to verify

BUG=26549815

Change-Id: I4a5fcd682654bd7925a15f1f51be808653f4e9be
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
64052d48e8fb56e03732ce73c7adaf1fe085bad0 15-Jan-2016 Etan Cohen <etancohen@google.com> Fix runtest failure: was overriding JNI library setting - exluding WPA

Bug: 26575015
Change-Id: I4a2e550252e1335045b4c3edda896937c4992203
ndroid.mk
fbb081b7c28c18f0644701061a1ab38a4627db27 15-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Store configKey in wpa_supplicant.conf

With per-user networks, the data normally present in wpa_supplicant.conf
will no longer be sufficient to reconstruct a network's configKey. The
configKey must thus explicitly be stored with each wpa_supplicant.conf
entry.

The wpa_supplicant.conf format provides a single variable for keeping
such metadata, "id_str". Since that variable is already used to store the
FQDN for Passpoint networks, it must be extended to hold both the FQDN
and the configKey. This is done by changing the variable's data format to
a serialized JSON dictionary. For future reference, the configuration's
creator UID is also added to the dictionary.

BUG=25600871

Change-Id: I2d63e21d1a87bb9645fed957479dcdb3d2642e38
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiNativeTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
39c3574fa3be035eafbf86462f3ca1bb859060fa 15-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Revert "Store configKey in wpa_supplicant.conf"

This reverts commit 3552d3bc8329aa9bc843f62c3a854e5ad2b41037.

Change-Id: Ib0d425baa3ac38a20d3ba660e5e5da490a1551e0
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiNativeTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
3552d3bc8329aa9bc843f62c3a854e5ad2b41037 14-Jan-2016 Bartosz Fabianowski <bartfab@google.com> Store configKey in wpa_supplicant.conf

With per-user networks, the data normally present in wpa_supplicant.conf
will no longer be sufficient to reconstruct a network's configKey. The
configKey must thus explicitly be stored with each wpa_supplicant.conf
entry.

The wpa_supplicant.conf format provides a single variable for keeping
such metadata, "id_str". Since that variable is already used to store the
FQDN for Passpoint networks, it must be extended to hold both the FQDN
and the configKey. This is done by changing the variable's data format to
a serialized JSON dictionary. For future reference, the configuration's
creator UID is also added to the dictionary.

BUG=25600871

Change-Id: I01518fee6237f4cf60efa4be92c3c7a1aff32704
rc/com/android/server/wifi/WifiConfigStoreTest.java
rc/com/android/server/wifi/WifiNativeTest.java
rc/com/android/server/wifi/WifiStateMachineTest.java
859240c33a7af91ed5cfe64813a0d296981d2f63 15-Jan-2016 Vinit Deshpande <vinitd@google.com> Merge "Unit test for WifiController's emergency mode behaviors" into mm-wireless-dev
f26259a93c77a0069deb46ca29a864de31c99ba6 15-Jan-2016 xin He <xinhe@google.com> Merge "Broken WifiStateMachine and Network Selection Test" into mm-wireless-dev
79a4204d12f32d2f6a4dfc8500f5e74718cabb8d 14-Jan-2016 Vinit Deshpande <vinitd@google.com> Unit test for WifiController's emergency mode behaviors

Change-Id: Ic3d8618501632d449bbd3432b95542ac92f336e4
rc/com/android/server/wifi/WifiControllerTest.java
17b7a795202659694aeb21e45b4dd4a4b016ac4d 15-Jan-2016 Etan Cohen <etancohen@google.com> Merge "NAN: initial service implementation for discovery" into mm-wireless-dev
8f3ec73d1ce52b3f23e4cccd6a202b5707874f46 15-Jan-2016 xinhe <xinhe@google.com> Broken WifiStateMachine and Network Selection Test

Fix the broken on Network Selection Test

BUG=26549815

Change-Id: I1e331c6c677b050b3625ca708c8513dcbd3c192f
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
956f54b391677d78379729dd14518edddf3c7660 29-Sep-2015 Etan Cohen <etancohen@google.com> NAN: initial service implementation for discovery

Initial NAN service implementation. Supports:
- Configuration
- Publish/Subscribe = Discovery
- Message passing
- Notifications

Bug: 26216681
Change-Id: I1f84a6006cec3c3ed9a4566a79b1b4f8dcecde08
ndroid.mk
ni/wifi_hal_mock.cpp
ni/wifi_hal_mock.h
ni/wifi_nan_hal_mock.cpp
rc/com/android/server/wifi/HalMockUtils.java
rc/com/android/server/wifi/nan/TlvBufferUtilsTest.java
rc/com/android/server/wifi/nan/WifiNanHalMock.java
rc/com/android/server/wifi/nan/WifiNanHalTest.java
rc/com/android/server/wifi/nan/WifiNanManagerTest.java
rc/com/android/server/wifi/nan/WifiNanStateManagerTest.java
2771787818003e53e8175036a3d09688c783f350 07-Jan-2016 Mitchell Wills <mwills@google.com> Fix a couple bugs in WifiScanner and improve tests

Ordering of scan results for HAL scanner implementation was wrong.
Generated scan results for tests were very similar in some cases leading
to tests missing the bug above. This CL makes generated scan results
dependant on the test case name as well.

Change-Id: Ibb35abf275db3585766be630585d0e3c8870494c
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
611faf5ce1f33711b71294aa0245f164bb3b09da 13-Jan-2016 Rebecca Silberstein <silberst@google.com> Merge "Tests for InformationElementUtil" into mm-wireless-dev
b907b456dfba8417b913508533145e374e40c2b7 13-Jan-2016 xin He <xinhe@google.com> Merge "Initial codes for Quality network selection [DO NOT MERGE]" into mm-wireless-dev
932de591430383f0704d1cec2e61b8f2b1657ee0 13-Jan-2016 Randy Pan <zpan@google.com> Merge changes I259c735c,Ia8006f3e into mm-wireless-dev

* changes:
Exponential back off scan unit tests
Scanner scheduler support for special scan request
f935e529bdcc150dc57641f5f2ab10cd69f2e3e9 12-Jan-2016 Randy Pan <zpan@google.com> Exponential back off scan unit tests

Added two unit tests for exponential back off scan.

Bug: 26236392
Change-Id: I259c735c952331601fbc2f5ac76b735ae3c64c77
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanTestUtil.java
7d2d8c27647676c51208e417afbb8dd6c6784b7c 13-Jan-2016 Mitchell Wills <mwills@google.com> Disable registering for scan events in SupplicantWifiScannerImpl

This interferes with WifiStateMachine getting scan events when the gscan
HAL is not supported

Bug: 26501100
Change-Id: I660f2457d4277a73be70467a463b9b9cf2944f83
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
8f0f666c8bdaf508f191f8590755140b92d970ea 01-Dec-2015 xinhe <xinhe@google.com> Initial codes for Quality network selection [DO NOT MERGE]

In this change list, the old WifiAutojoin module is
refactored initially. The old WifiAutojoinController is
replaced with a new WifiQualifiedNetworkSelector.
WifiConfiguration, WifiConfigureStore and
WifiStateMachine have been modified accordingly. The new
network selection logic is refactored with a more clear
and deterministci one. To refer to thedescribed in
details, in "Quality Network Selection and Connectivity
Scan Management in N". The link of the document is:
https://docs.google.com/document/d
/1JPTa2NEk-PgjCJ16fIrR6ohV-kDKveDlYDOeiMCB2_c

Also the initial unit test codes are added. Test case of
5GHz network over 2GHz network is added.

Bug:26012244

Change-Id: I8dc240115c0625c0fae13a5b3965f70556040448
rc/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java
da51c12f413d54517aea317e37ba82e45d1e4a30 16-Dec-2015 Rebecca Silberstein <silberst@google.com> Tests for InformationElementUtil

Add tests for parsing InformationElements. Covers multiple types of invalid
input.

In addition, added check to parseInformationElements to check for null
input. If the input byte array is null, returns an empty
InformationElement array.

Bug: 26228026
Change-Id: I49e0f6ca938e07c7d961853279645f8511dbd0c3
rc/com/android/server/wifi/InformationElementUtilTest.java
b35c2105231b61606db78d4bf8a75ec31039db61 11-Jan-2016 Etan Cohen <etancohen@google.com> Merge the MockLooperAbstractTime functionality into baseline MockLooper

The time functionality (post delayed event) of MockLooperAbstractTime is
additive: i.e. base functionality (without posting delayed or moving time)
is identical to MockLooper - hence no need to have a separate class.

Change-Id: I01ae48712534a4c08003a5a6271a66c8c9bf984c
rc/com/android/server/wifi/MockLooper.java
rc/com/android/server/wifi/MockLooperAbstractTime.java
rc/com/android/server/wifi/MockLooperAbstractTimeTest.java
rc/com/android/server/wifi/MockLooperTest.java
f7267fc5dd0ac9bf7cb1e184f5818cc0b6e977ec 08-Jan-2016 Etan Cohen <etancohen@google.com> Merge "Add/extend MockLooper to handled messages posted with a delay." into mm-wireless-dev
e1e1c7317e5e5d61daf90cd2f2861305f19890b7 08-Jan-2016 Etan Cohen <etancohen@google.com> Add/extend MockLooper to handled messages posted with a delay.

MockLooperAbstractTime allows moving time forward and dispatches
messages per the current time.

Change-Id: Ic87a609db86011b7b909353122fabe7cb440b61f
rc/com/android/server/wifi/MockLooper.java
rc/com/android/server/wifi/MockLooperAbstractTime.java
rc/com/android/server/wifi/MockLooperAbstractTimeTest.java
57483a79c2f9d5a9fe3e950553d95f3ad75842a3 08-Jan-2016 Vinit Deshpande <vinitd@google.com> Merge "First WifiStateMachine UnitTests" into mm-wireless-dev
eee1d479d8d402a2e78e2f143e957030cfc77749 29-Dec-2015 Vinit Deshpande <vinitd@google.com> First WifiStateMachine UnitTests

Change-Id: I044b54f18f1a75b5b33c3fc9fc71a8da820d2521
ndroid.mk
rc/com/android/server/wifi/MockResources.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/WifiStateMachineTest.java
80a936cbedcec10cf81d3ae6d457fb6812a7e9ea 08-Jan-2016 Mitchell Wills <mwills@google.com> Fix wifitests build failure on platforms without wpa_supplicant

Change-Id: I41a3b35067d32b97441ad2f198fc88bd54431b56
ndroid.mk
0d83625c25353c92c123f552939eea4b33074b60 08-Jan-2016 Mitchell Wills <mwills@google.com> Remove libwifi-service dependancy on libandroid_runtime

Rewrite call to AndroidRuntime::registerNativeMethods to call
jniRegisterNativeMethods directly. This reduces the number of dependant
libraries that must be included for testing.
Also package libwifi-service's dependancies that are not noramlly
available from applications in the wifi test APK.

Change-Id: Ifdb6692646362c51661ea91f02bfd7f04ac02464
ndroid.mk
1a16020f8d611c94797884b212ee6a26817fad82 16-Dec-2015 Mitchell Wills <mwills@google.com> Some improvements for WifiScanner scheduler

Make sure that bands are used instead of channels lists if they can
represent all requested channels.
Only deliver the maximum number of bssids requested and no more.
Make sure chips maximum number of bssids per scan is respected.

Bug: 26217163

Change-Id: Iac9cd9f3983f2e1397aec7802155358516d154bf
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
5fa6221c4e507cbc596b6de77d793ec08d690157 12-Dec-2015 Mitchell Wills <mwills@google.com> Add support for oneshot scan API in supplicant WifiScannerImpl

Implement startSingleScan for in SupplicantWifiScannerImpl
Also some style cleanup in SupplicantWifiScannerImpl
Refactor HalWifiScanner tests to be a base for both supplicant and hal
implementations

Change-Id: Ic6d4db7acda39207861bad8b33ddb433c3917b8b
rc/com/android/server/wifi/BaseWifiScannerImplTest.java
rc/com/android/server/wifi/HalWifiScannerTest.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
f2f6f79242454ff9161f5af772292fa0180436f8 04-Nov-2015 Mitchell Wills <mwills@google.com> Make HAL oneshot wifi scans use wpa_supplicant

Currently this code path isn't used, but will be enabled once the
supplicant scanner implementation also supports the seperate oneshot
scan api

Change-Id: I23ce63172b82b9b4b824093885f78064fc064144
rc/com/android/server/wifi/HalWifiScannerTest.java
72c639e8b97067e948eca8be50dfea3173121090 04-Nov-2015 Mitchell Wills <mwills@google.com> Cleanup wifi tests style

Make all tests follow style defined in development/tools/checkstyle

Change-Id: I18b24956f4fdecde8f02ebcc9089065b4a5b7e68
rc/com/android/server/wifi/ExampleWifiTest.java
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/MockLooper.java
rc/com/android/server/wifi/MockWifiMonitor.java
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
41e38d84f562e12198f7db0d45f633712cae6cba 19-Nov-2015 Mitchell Wills <mwills@google.com> Tests for SupplicantWifiScannerImpl

Other small fixes/aids for testing
* deliver full scan results in the order they are returned from
supplicant
* Now use AlarmListener AlarmManager API instead of intents
* Use WifiChannelHelper instead of direct native calls

Change-Id: I3133a21162f598e5e5973ec67ebc9521a3a387ab
rc/com/android/server/wifi/MockAlarmManager.java
rc/com/android/server/wifi/MockLooper.java
rc/com/android/server/wifi/MockWifiMonitor.java
rc/com/android/server/wifi/ScanResults.java
rc/com/android/server/wifi/ScanTestUtil.java
rc/com/android/server/wifi/SupplicantWifiScannerTest.java
297c3acabe7a85eb87240fe3ccf772e57ce6aef7 23-Jul-2015 Mitchell Wills <mwills@google.com> Add multi client batch aware scheduler

WifiScanner can now schedule requests much more intelligently.

Bug: 20956158

Change-Id: Ib852d1d84d8cc798a37660850d5e6f3a206390c1
rc/com/android/server/wifi/MultiClientSchedulerFilterTest.java
rc/com/android/server/wifi/MultiClientSchedulerTest.java
rc/com/android/server/wifi/ScanTestUtil.java
bfc12650118120f1b119094fed5174fe2f8eb686 04-Dec-2015 Mitchell Wills <mwills@google.com> Add more documentation to wifi tests readme

Change-Id: I013aa1e5e58a18a2eed6406215da4b0abc780abf
EADME.md
5ba6152092301bbdea7e2838727b63dc40dd8c4a 03-Dec-2015 Mitchell Wills <mwills@google.com> Setup framework for wifi unit tests

Change-Id: I6f5fe51c567d0464fead06daf4a6018f4bb403cd
ndroid.mk
ndroidManifest.xml
EADME.md
rc/com/android/server/wifi/ExampleWifiTest.java