History log of /frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
095121ada1c9ea6034e86606395de20cddcad9ba 07-May-2018 Roshan Pius <rpius@google.com> WifiConfigManager: Do not disconnect on temp failure due to no internet

This will let network selector find a better candidate, if available.
If network selector does not find any other candidates, we will remain
connected to the no-internet network.

Bug: 72635747
Test: Unit tests
Test: Manually verified that device did not disconnect from an
auto-connected network when it detects no internet.
Change-Id: I5cfaff1ef534b4f638e7a147d79d2c264718ce2b
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
86ea918f785f665e0fa41ddd5d6803d73ad72650 16-Apr-2018 Roshan Pius <rpius@google.com> WifiConnectivityManager: Add config flag for filtering DBS scans

OEM's may want to disable this filtering logic for their devices.

Bug: 78112990
Test: Unit tests
Test: Ensured DBS scans are still filtered when enabled.
Change-Id: Id3bf5b0f0be49c89341f87bac97f4e339d1eb27a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
79545bef4e8d6c1d891f7396665b5c457bc31617 09-Mar-2018 Michael Plass <mplass@google.com> [wifi_score_params] plumb to the various scorers

Also hook up horizon in VelocityBasedConnectedScore.

Bug: 65216267
Test: Unit tests
Test: Install on phone, then adb logcat -d | grep WifiScoringParams
Test: For various foo, adb shell settings put global wifi_score_params foo
Test: adb shell settings delete global wifi_score_params

Change-Id: I333918c3951c9431dadd29de44058a869bdc60d4
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
84f6d8d25d5982b703a74113083e814c9fe5b28f 06-Mar-2018 Mehdi Alizadeh <mett@google.com> Check if Imsi encryption info are available

The original fix for b/74090333 (ag/3699759) was dropping all carrier
networks if carrier encryption info is not available. Instead, this CL
keeps the carrier network map regardless of encryption, and checks for
carrier encryption every time Carrier Network Notifier is being called.

Bug: 74090333
Test: Unit tests
Change-Id: I3f8b70c4a496053433a402008424638685ac8f71
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
9a50fce0dd19fa80a37c2f851772811f823685bd 31-Jan-2018 Rebecca Silberstein <silberst@google.com> WifiStateMachine: remove link debouncing

Remove logic related to link debouncing.

Bug: 72643098
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Wifi Integration tests
Change-Id: Ied69a6b4feed3a97523b97076ca0b6da3bc95b2e
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
7f2a1e30dd5d14320ffc7b185ac25fdb79fe52b0 23-Jan-2018 Etan Cohen <etancohen@google.com> Update SmallTest library

android.test.suitebuilder.annotation.SmallTest is deprecated and
replaced by android.support.test.filters.SmallTest.

Update all test files. No other change (except import order cleaning
up to pass preload format check).

Bug: 72324160
Test: all unit tests pass
Change-Id: Icc4abe3b3b37926d583c0d4ae510a7d7c74c1a03
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
664a859a1cc81f6c679e7da44768238374e102f1 21-Jan-2018 Mehdi Alizadeh <mett@google.com> Adds CarrierNetworkNotifier and unit tests

Bug: 69310016
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I047fdd705ebd969290b9e096f6fd7a3fe5bef629
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
652381b37461a4aa793327365e144bb4335cbd27 19-Jan-2018 Roshan Pius <rpius@google.com> WifiService: Request/Process high accuracy scans

In WifiConnectivityManager:
a) Use the new DBS params to always request high accuracy scan type for
connectivity purposes.
b) Ensure that we only use scan results obtained using
both the radio chains (if DBS supported on the device) for connectivity purposes.

In ScanRequestProxy:
Scan requests from apps holding network settings permission will be
requested with high accuracy type.

Bug: 68335251
Test: Unit tests
Test: Manual Tests (Verified scans from settings & WCM request
HIGH_ACCURACY scans, while those from GMS core don't).
Change-Id: I8807ee825b578d62690e2da073ebb46ebdb207e9
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
54e1f042c35507cefb8bb7b88c5d1dbd6f45aa97 15-Nov-2017 Ningyuan Wang <nywang@google.com> Disable partial scan if firmware roaming control is enabled

We used to request partial connectivity scan instead of full
band scan when screen is on and there is traffic over wifi.

Partial scans only cover channels known for APs with the
same SSID. Since intra-SSID roaming is controlled by firmware
on some devices, we don't need these partial scans anymore.

Bug: 69321070
Test: compile, unit tests, integration test
Change-Id: I943b84e8a04ebc9ac1c47cca7cdcef2bf98f30ad
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
470817b13e56d915805729ab4f51075f3fa2ec15 19-Sep-2017 Ningyuan Wang <nywang@google.com> Blame scan request from WifiManager.reconnect()

Bug: 65839442
Test: compile, unit tests
Test:
1. Write a simple cts test case WifiManagerTest#testWifiReconnect
only calling WifiManager.reconnect()
2. Make sure wifi is disconnected
3. Run cts test using:
cts-tradefed run cts -m CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest#testWifiReconnect
4. Grab bugreport
5. Verify the following logs appears:
forceConnectivityScan in request of WorkSource{...}

Change-Id: I7fa7803e90ba950c9331a55cb1268baef4ae02a8
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
9686c96d8d0c0bc21ca069e244e2570c169724e1 28-Sep-2017 Lorenzo Colitti <lorenzo@google.com> Allow connecting with no requests if we're already connected.

Currently, we drop all connection start attempts if we do not
have any NetworkRequests that we can fulfil. This can happen if
the default network has a score that's higher than our score
filter. The reason for this is that we don't want to connect a
new network if we're not already connected: if we did,
ConnectivityService would immediately request that the network be
torn down.

However, it does make sense to connect if we are already
connected, because that means that we ourselves are the
highest-scoring network - otherwise, ConnectivityService would
have torn us down. So, when deciding whether to process a
connection request, allow it if mNetworkAgent is non-null, even
if there are no NetworkRequests that we can fulfil.

In order to do this, move the check from startConnectToNetwork to
the code that processes CMD_START_CONNECT, because it's not safe
to access mNetworkAgent except from the handler thread. Moving
the check also seems more correct in general, because
the return value of hasConnectionRequests() could change between
when startConnectToNetwork is called and when the resulting
CMD_START_CONNECT is processed.

The connect requests are only allowed from the settings/sysui. We don't
allow any non-privileged apps to be able to override the user's decision
to stay connected to a network with no internet access (which causes the
mNetworkAgent.releaseNetworkFor()).

Bug: 65262556
Test: Unit tests for START_CONNECT handling for 4 scenarios:
a) START_CONNECT with the default network request.
b) START_CONNECT with no network request.
c) START_CONNECT with no network request, but already connected
d) START_CONNECT with no network request, but already connected, but
from non-privileged app.
Test: Settings can connect to a new network when wifi has a score of 100

Change-Id: Iad582b5109a81f238f335eaac3e7264c5da6e9b1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
b6103294dc1e6785c8ba236582e53801e1f9f2cd 08-Sep-2017 Stephen Chen <stewchen@google.com> ONA: Enable new UI and connection flow.

The new Open Network Available notification UI introduces a connection
flow in which users can connect to a recommended open network directly
by interacting with the notification. "Connect" and "See all" action
buttons are introduced to initiate the flow, and once a connection
attempt is made, the connection status will be reflected on the
notification.

Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I30231c4f71476a7417a3b423848575d5488f51f7
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
08ffa580f6756129929667785408da377b363787 25-Aug-2017 Stephen Chen <stewchen@google.com> ONA: Implement connection attempt and failure callback.

Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I2d531304598249dcb18bdc45492e48ee90ddff5f
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
ce76a17ac5010e0b7ff5dcf6d8c9db8b48280f9c 26-Jul-2017 Stephen Chen <stewchen@google.com> ONA: Rename WifiNotificationController to OpenNetworkNotifier

Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: If59ecbd3078452f05e156091df1d098c8469a66a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
0f41a6a3df4a2cedcad60324d91e1fffc968cfbb 18-Jul-2017 Stephen Chen <stewchen@google.com> ONA: Track screen state in WifiNotificationController.

The Open Networks Available notification should not be shown when the
screen is off.

Bug: 38460614
Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I445f95a624009f492c3abd8a9f815706e221ea44
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
3f8483262cf59572d0c0b3c42e72d8ce65a096ff 06-Jun-2017 Stephen Chen <stewchen@google.com> ONA: Change ONA controller to directly handle scan results from WifiConnectivityManager.

The controller will post and clear ONA notifications based on calls made
from WifiConnectivityManager.

Bug: 38460614
Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ib3483e8974d37b165249a211306118b83dc4edc4
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
22e5e8f87167102259092bbeaa14c656e090bd67 14-Jul-2017 Ningyuan Wang <nywang@google.com> Re-enable PNO unit tests for WifiConnectivityManager

Bug: 32977707
Test: compile, unit tests
Change-Id: I25e9b07fc43029c19f17b77a6c50701d07871d9d
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
e4606e0f9532d250a1e06e8aba5fb48556225773 31-May-2017 Randy Pan <zpan@google.com> Use partial scan trigger configurable parameteters

Instead of hard coding the values in WifiConnectivtyManager.java,
now get the values from the config.xml.

Bug: 31180330
Test: runtest.sh
Change-Id: I7cfd715253ad9c041a4a6f11d79204be5758815a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
adf5ee14bfcdef705684b1c4f12d80fae8433170 10-May-2017 Peter Qiu <zqiu@google.com> Fix test failures in WifiConnectivityManagerTest

Tests are failing due to unset expectation for calls to
Context#getPackageManager. Fix it by set up the expectation
to return a mock PackageManager.

Bug: 38205928
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I43e76989b12e93ac8f1e405835feec8ee10cadf1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
5d0addadb370bcbb8900414fb9597bd415e6fea0 03-Apr-2017 Randy Pan <zpan@google.com> Update PNO scan network list upon network update

Add a listener interface in WifiConfigManager to notify events
such as network being enabled, disabled, blacklisted or
un-blacklisted.

WifiConnectivityManager listens to the above events and update
the PNO scan network list if necessary.

Bug: 30399964
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I75523a3a53ff62b14d485fd722354c4d6c3b18c1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
17c2a7b30e5680b11fc0073ce322ee7bc14ef2c5 03-Feb-2017 Randy Pan <zpan@google.com> Local log buffer shared by connectivity modules

Move the creation of the local log buffer for connectivity modules to
WifiInjector. Then pass it over to all the connectivity modules.
Dump the log buffer via WifiConnectivityManager.

While there, removed the null check in localLog() for all the
connectivity modules.

Bug: 35642622
Test: runtest.sh and manual test
Change-Id: I31866c6fecdd9f50061f47e34e16c701ff230a6c
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
ab8c62a5c348702090aceee23de12945cc3fdb0d 27-Feb-2017 Randy Pan <zpan@google.com> Firmware roaming configuration management

Clear the BSSID blacklist when starting/stopping
WifiConnectivityManager or when we are about to connect
to a user or app specified network. Write the new roaming
configuration to firmware when the BSSID blacklist is
updated and both WifiConnectivityManager and Wifi client
mode are enabled.

Bug: 35642221
Test: runtest.sh and manual tests
Change-Id: I841c30f9218b4615252f9a75490a480e2f2d0265
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
b6686e9d42895f9c2b9f4278cd892149bee04e3a 01-Feb-2017 Randy Pan <zpan@google.com> Always honor config specified BSSID

When WifiNetworkSelector recommends a network for connection and the
WifiConfiguration of the network has a BSSID specified, we always
use that BSSID for connection attempt no matter firmware controls
roaming or not.

If the WifiConfiguration doesn't have a BSSID specified,
WifiConnectivityManager doesn't specify a BSSID for connection attempt
if firmware controls roaming.

If the BSSID of the scan result for the recommended network
configuration doesn't match the config specified BSSID, we drop the
connection or roaming attempt.

While there, made the indent style consistent in the unit test file.

Bug: 35641886
Test: runtests.sh and manual tests.
Change-Id: I888a65f2f9d4cb418f43775a8ecd1035c0cead28
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
a54399f6da655dfbe440333ca3682b9199060a27 18-Jan-2017 Randy Pan <zpan@google.com> Hand off roaming to firmware if supported

If firmware supports the controlled roaming feature, don't specify
the target BSSID when connecting, and framework no longer initiates
roaming.

While there, cleaned up the indent of localLog() messages in
WifiConnectivityManager.java.

Bug: 35642216
Test: runtests.sh and manual tests
Change-Id: I02355c9b49bbd9275365a43151cc11a81c4696aa
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
3697d5ed11fea02e6369336d54e19145ba76425f 24-Mar-2017 Randy Pan <zpan@google.com> Fix WifiConnectivityManagerTest

Bug: 36407367
Test: runtests.sh against WifiConnectivityManagerTest
Change-Id: I3eb5342b55fc5dfc40f4a6a45a249d956f802e1f
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
167b90b5e002698378728a54a417a08c317d29dc 25-Feb-2017 Randy Pan <zpan@google.com> Move BSSID blacklist to WifiConnectivityManager

Now the BSSID blacklist is managed by WifiConnectivityManager and
passed to WifiNetworkSelector for scan results filtration.

Bug: 35642214
Test: runtests.sh and manual tests
Change-Id: I7afb5e66be471f3582075adb687a7d85ba49a80b
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
915a3782e33684562dff8a0897d1446227301b75 13-Mar-2017 Randy Pan <zpan@google.com> Schedule a scan immediately when disconnected

This gives the device a chance to reconnect as soon as possible.

Bug: 35188856
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I8eb019ca11b2b63ab17edcc2fa60fb8795141951
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
50f36ec6fe906445db996bf3918e5cb3f170bc79 22-Dec-2016 Peter Qiu <zqiu@google.com> hotspot2: integration of network evaluator for Passpoint

Bug: 32714185
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Manual testing with a Boingo Passpoint AP using a bullhead

Change-Id: Ib71723bed332aa850485edd98ebdcbfcf8ec22c7
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
dfc4219e2d230cdce654c26aed3680fece04ddb5 07-Jan-2017 Amin Shaikh <ashaikh@google.com> Observe settings in RecommendedNetworkEvaluator.

If NETWORK_RECOMMENDATIONS_ENABLED is set, use
RecommendedNetworkEvaluator, otherwise use ExternalScoreEvaluator.
Previously, this setting was only respected at boot time, however,
users can toggle this setting at runtime. This change forwards method
calls on RecommendedNetworkEvaluator to ExternalScoreEvaluator when
this setting is disabled. ExternalScoreEvaluator will be removed in
a later change.

Test: runtests.sh
Bug: 33694202
Change-Id: I67e73d4e2c4cdff465d23056b59554fc9d8ab64a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
c8701c8ad058ec7fa69a2e3c60495f27708bced5 05-Dec-2016 Sundeep Ghuman <sghuman@google.com> Remove old WifiNetworkScoreCache.java

Updates references to this file to use the score cache defined in
frameworks/base.

Bug: 33050254
Test: Compiles successfully
Change-Id: Id8b3eed40c3f0005fa289e0a2ae67297b4e4434f
Topic: WifiNetworkScoreCacheMove
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
d0258ee4816148ff4ab9ac6b854fc5c51ea53be3 05-Dec-2016 Amin Shaikh <ashaikh@google.com> Implement RecommendedNetworkEvaluator.

- Gate usage on NETWORK_RECOMMENDATIONS_ENABLED flag
- Delegate WifiConfiguration selection to NetworkScoreManager
- Added RecommendedNetworkEvaluatorTest

Test: runtest frameworks-wifi

Bug: 33158114
Change-Id: I10b870df891269fd474daa2db53d43ac5050af2c
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
0b9616e0e126221238edf5843a01b0cd3ec4daee 06-Dec-2016 Stephen Chen <stewchen@google.com> Refactor WifiNetworkScoreCache in ExternalScoreEvaluator to WifiInjector.

This allows us to share the cache in WifiNotificationController

Bug: 33355924
Test: runtest --path
frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
runtest --path
frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/ExternalScoreEvaluatorTest.java

Change-Id: I934b29fb5287180610355588ed7fa43018ccd4aa
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
b4de842310ca698d59ed5b9117d38362e2945947 22-Nov-2016 Rebecca Silberstein <silberst@google.com> WifiInjector: add WifiConnectivityManager

Add call to create a WifiConnectivityManager instance to WifiInjector
and remove the direct call from WifiStateMachine.

Bug: 33052869
Test: runtests.sh
Test: verified connection to network after toggling wifi
Change-Id: Ic7a11a3696a24274a178ddedec18e62ca42d3a2d
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
2bf8cc9cabe26484345f416136495a767b453e01 17-Nov-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Disable PNO scans

Will enable this back once wificond is ready to accept PNO scan
requests from WifiScanningService. For now, we'll perform periodic
single scans instead of PNO when screen if off & disconnected.

Bug: 32907581
Test: Will send for regression tests
Change-Id: I6a4ade71626524fadbe515720f07fed3c28aa967
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
60ecc292c27e34df1a9414da0d6482cce718efbc 11-Nov-2016 Randy Pan <zpan@google.com> WifiConfigManager: partial scan channel list

Always include the channel of the currently connected network in
the channel set returned by
fetchChannelSetForNetworkForPartialScan().

Bug: 32745312
Test: Wifi unit tests.
Change-Id: I94a653a2e15222c7f615e9f2c1c3234ba0f1bb09
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
6c90568a19e32a1825e06a608e59d3f36daff9ca 03-Oct-2016 Randy Pan <zpan@google.com> Move WifiNetworkSelector to WifiInjector

While there, move WifiInfo to be an input parameter of
WifiNetworkSelector#selectNetwork and make WifiInfo the
sole source for obtaining information of the currently
connected network.

Bug: 31383992
Test: Wifi framework unit tests
Change-Id: I107ba600165b008079cebf230865f8b2082740a8
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
cf69e50f5344898a0a89f838f63322a2df01bf5d 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
Merged-In: Ie220c25dd60a0534afbf33f62691f32515f7062b
Change-Id: Ie220c25dd60a0534afbf33f62691f32515f7062b
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
220d198691d07506137b6af0bae810ed47ac4ed6 09-Sep-2016 Randy Pan <zpan@google.com> WCM: unit tests

Brought up the WCM unit tests with the new Wifi Network Selector.

While there, fixed checkstyle issues.

Bug: 31380721
Test: unit tests passed.
Merged-In: Id6c658cf9287cfad97f37e2d89fbf92fee58a49b
Change-Id: Id6c658cf9287cfad97f37e2d89fbf92fee58a49b
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
026cb51837e4cf3aea30b903320b992a3f5d0d7b 20-Sep-2016 Christopher Wiley <wiley@google.com> Remove implementation of user selected WiFi bands

This functionality artificially limits WiFi's ability to connect to WiFi
networks and establish connectivity. We already prefer 5Ghz networks
to 2.4Ghz networks, and offer knobs to scan on a particular band.

The UI that exposed this feature has been removed since M.

Bug: 31148223
Test: builds, unit tests pass

Change-Id: I8ae1f9d2b7217d404557fb69eccb2dd42799d4df
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
fa25be15a3dab0fda8d041798c4cac531d0d0866 07-Sep-2016 Roshan Pius <rpius@google.com> WSM: Handle external connection requests

The current implementation of enableNetwork() with disableOthers flag
set to true returns failure if the app does not hold the
OVERRIDE_WIFI_CONFIG permission. This is not backward compatible.

Instead, handle any external connect requests
(using enableNetwork, connect or save_network) using the following logic:
1. If the app holds the OVERRIDE_WIFI_CONFIG permission, immediately
trigger a connection to the requested network.
2, If not, force a connectivity manager scan and let QNS pick the best
network to connect to.

While there,
Remove the persist flag from QNS & WCM and rename the network
select method. The new name better reflects that we're just setting a
connect choice and not actually initiaing a connection.

BUG: 31272462
BUG: 31275240
BUG: 31216628
TEST: Unit tests
TEST: The WifiUtil.apk app used for smoke test verification now can call
enableNetwork successfully and ensure that we connect to the required
network.
TEST: android.net.wifi.cts.WifiManagerTest#testWifiManagerNetWork passes
now.

Change-Id: I540143e46dae55cd114711350b3676cd071f9930
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
fe993ca46449a8aab3f7f55e2132456064bcee94 30-Aug-2016 Roshan Pius <rpius@google.com> WSM: Integrate new config manager

Changes in the CL:
1. Separated out the config management control path from wpa_supplicant
interactions.
2. All configuration updates are fully handled in WifiConfigManager and
hence remove all redundant code from WSM.
3. All connection requests are now handled from |CMD_AUTO_CONNECT|. Any
user/app selections will be routed to |CMD_AUTO_CONNECT|. This message
will now mark all wpa_supplicant interations for new connection
attempt. This ensures that we have a single control path for all
connection attempts going forward.
4. Similarly |CMD_AUTO_ROAM| will be used for all roam requests.
5. Replaced all the exiting WifiConfigManager methods with equivalent
ones from the new WifiConfigManager class.
6. All networkId's recieved via WifiMonitor events needs to be
translated to internal networkId using |lookupNetworkId| method.
7. Removed all passpoint config management code and added TODO's for
zqiu to tackle later.

BUG: 31009287
TEST: Unit tests
TEST: Integrated with WSM and verified wifi connectivity.
Change-Id: Id9e209a3cb1b3fef47ba7469c1de020210e3ca60
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
94eec4ff65e7e4c1c06c3e817655842b46c02b0a 30-Aug-2016 Roshan Pius <rpius@google.com> WCM: Integrate new config manager

Most of the changes in the CL are just replacing the old config manager
methods with equivalent ones from the new config manager. Other than
that, all device config values are read directly by WCM and cached
instead of reading it from WifiConfigManager.

BUG: 31009287
TEST: Unit tests
TEST: Integrated with WSM and verified wifi connectivity.
Change-Id: I51b08b817eb884dc1d5186b0e929872db495878a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
1ecbde12cbde58696b784df5d41e486ea5d51026 25-Aug-2016 Randy Pan <zpan@google.com> resolve merge conflicts of 3f6f755 to master

Change-Id: I4af48aba54c674cad8147e67daf162a068b03fa6
3f6f7553a75bdb6936e3677d416c6dadaea61d68 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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
08b0d15630a098c6da46bd32387e58804a7f26db 29-Jun-2016 Randy Pan <zpan@google.com> WCM: Listen to all single scan results am: cb26f07ae9
am: 620da8a80e

Change-Id: Ibf033101ca901f2ccee04d19fe07e53196bc9886
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
3b3013efaefa13147c8e3f5d38bc7cfada06469e 22-Jun-2016 Randy Pan <zpan@google.com> Merge \\"WCM: reset connectivity scan retry counter\\" into nyc-mr1-dev am: a780a159b7
am: 133804e905

Change-Id: I024e759fd1c720215ad9cd5443cc052498b15e6a
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
9e3eb23ebd21b93625914e77ec86d4034d915160 08-Jun-2016 Randy Pan <zpan@google.com> Merge \\"WCM: No connectivity scan if auto roaming is off\\" into nyc-mr1-dev am: 0ef8048dbb
am: b80be3eb81

Change-Id: Ia9356ea492452c2c55b9076678e20ff1442ea476
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
5967a15d36c76ba1aaeb89ce8bd66bb4bccfe998 07-Jun-2016 Paul Stewart <pstew@google.com> resolve merge conflicts of 9fd75a2 to master

Change-Id: I5ac96f6035e3412e0dedba3a4869e9568047752d
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
ef9e66e6dfe56ecb2015538afa3b8a4d10fa546e 19-Apr-2016 Randy Pan <zpan@google.com> Wifi QNS clean up

Cleaned up QNS comments and log messages.

Bug: 27932378
Bug: 27297354
Tests: Wifi Framework Unit Tests
Change-Id: I4e40c9ddb6329bbadeea724286f94585ff1d5a5d
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
5de29ec72c54cb73fdc1b59072f66a2627b8764c 25-May-2016 Ningyuan Wang <nywang@google.com> Migrating existing code to Clock abstraction part 1

This CL includes the following changes:
Refactor Clock.java for better readability
Use Clock abstraction for classes which already have
a reference of Clock obejct.

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

Change-Id: I49e896a91a63cf4519368a9de259046c21c94ddb
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
240fdc87ad51f0449c92f1c3981c93ea022729bb 25-May-2016 Randy Pan <zpan@google.com> WifiConnectivityManager: enforce minimum single scan interval am: c2963eb076 am: 28eb5a8fe0
am: b7c99688e3

* commit 'b7c99688e3f7e4049f8a3c079894c3a054e10254':
WifiConnectivityManager: enforce minimum single scan interval

Change-Id: I0fc5b77fba2bf7795b41c330f70f6ecad4efd0a9
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
256ee9e914f0e7470a4a0f804d2d5ce7f1a9697d 21-May-2016 Roshan Pius <rpius@google.com> resolve merge conflicts of cbb193c to master

Change-Id: I8ba39ea770cef1f5163452fd322631356de80d15
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
8a7b2c7cdb729887535aba20d2663a4cf133f983 21-May-2016 Roshan Pius <rpius@google.com> Merge "WifiConnectivityManager: Fall back to full band scan" into nyc-dev am: a2cc709215 am: db2730060d
am: 395cf5eb40

* commit '395cf5eb4072edf27d8ef7e411ffcdde61076e57':
WifiConnectivityManager: Fall back to full band scan

Change-Id: I0326981f8e44f719584eb552efd93851e1146ec9
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
/frameworks/opt/net/wifi/tests/wifitests/src/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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
f4267b6840dbc7f430638c35c5448187b6e83846 19-May-2016 Christopher Wiley <wiley@google.com> Move test components into its own static library

This allows us to share the class with networking code
in frameworks/base/services. Moved:
- MockLooper
- BidirectionalAsyncChannel*
- MockAlarmManager
- MockAnswerUtil

Bug: 28848133
Test: These tests continue to pass

Change-Id: I97bba188da1eb07aa8f6fccf6f051c48b197d5f1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
00f5ad8bafa58232b799e5195783a444fa9168fe 02-May-2016 Randy Pan <zpan@google.com> Merge "WifiConnectivityManager: PNO retry for low RSSI 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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
e78a18cf874b4d9bb5db2ef7804b8ac576e56489 09-Apr-2016 Mitchell Wills <mwills@google.com> Fix unit tests after rebase of scan worksource CL

Fixes: 28096237
Change-Id: I1f9d9284f3b2a09892d2d1d1ff4a3faccb54d616
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.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.
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
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
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java