History log of /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f0653448fc27d0f73d58a3abf948ef38609331e4 08-Sep-2017 Stephen Chen <stewchen@google.com> Merge "ONA: Enable new UI and connection flow." into oc-mr1-dev
7fc4bd4bdbe70f4d1e7c471ba008c7c4f9f287e8 08-Sep-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "ONA: Implement connection attempt and failure callback." into oc-mr1-dev
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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
eb3dfcbab191efe0532294b75a5e2ce6837ce1c9 31-Aug-2017 Jeff Sharkey <jsharkey@android.com> Meteredness should reflect user opinion.

While cleaning up the original meteredness refactoring CL, I must
have dropped the usage of WifiConfiguration.isMetered() which blends
together all the various options to decide if a network should be
treated as metered or not. Fix that bug.

Also update the capabilities whenever a configuration is updated,
since the user (or tests) may have just changed their meteredness
opinion.

Test: cts-tradefed run commandAndExit cts-dev -m CtsHostsideNetworkTests
Bug: 64274313
Change-Id: I6b4df07b6222810f7b3790a5c2f1685dfe3535c9
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
3d8ab23deeb76ac4ec4de1cd3eb446e3c55ce732 18-Aug-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Wifi connection hysteresis" into oc-mr1-dev
fac6568cbb329e06b22bfe07993acb263f3762ab 09-Aug-2017 Michael Plass <mplass@google.com> Wifi connection hysteresis

Making an automatic connection should not happen unless the RSSI
is a little bit above the level at which a connection is considered
to be "bad", to avoid flapping back and forth between wifi and cell.

Bug: 64422319
Test: Unit tests, manual
Change-Id: I9a148f2d66ea835d19696eb6317b682f6756f002
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f30b8a95e4e2ab07ec6535c4afb12d56ea0417c5 09-Aug-2017 Glen Kuhne <kuh@google.com> Merge "METRICS: histograms of scanresult sums in scan" into oc-dr1-dev
am: 26f0c1ee6a

Change-Id: Id1a087ca02cd44e016cbe8e870995f6f41d2b4b1
08631913ff641047b1d56288bd194a1fa7c390e1 25-Jul-2017 Glen Kuhne <kuh@google.com> METRICS: histograms of scanresult sums in scan

Generate histograms counting the size of 5 different ScanResults
subsets within a scan. Subsets include: total, open,
saved, open-or-saved, or passpoint related scan results. The size is
counted for unique BSSIDs & unique SSIDS, generating two histograms.

This metric is useful for determining the frequency of N-way
network-selection decisions (where N is the number of connectable
networks).

Exempt-From-Owner-Approval: Prior approval by owners (rpius)
Bug: 36819798
Test: Added unit test
frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I4825a778d45f9306f3e83b2418a047b8809c1802
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
0d8aa539a5617f20c3f68d1742ec817235f1d6af 25-Jul-2017 Stephen Chen <stewchen@google.com> Merge "ONA: Track screen state in WifiNotificationController." into oc-dr1-dev
am: 425676edcb

Change-Id: I5f93dcdd884c26f4da5caa06ff88c52cc705f519
81d5f8644b7614ca1741be69010e9203131056c7 25-Jul-2017 Stephen Chen <stewchen@google.com> Merge "ONA: Change ONA controller to directly handle scan results from WifiConnectivityManager." into oc-dr1-dev
am: 6db34c0303

Change-Id: I17358c6b6918f534a37080086ca817a7a587c81a
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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
7246a9b3a1f20ab0fdb1ce532f36a2ab0e44fe2a 19-Jul-2017 Stephen Chen <stewchen@google.com> Merge "WifiNetworkSelector: cache filtered scan results" into oc-dr1-dev am: 9cffbf45e2
am: dad9e0f432

Change-Id: I93db4e87c002d9f3c66e4e642ff0838a78082444
eb04ff08fe0985acd105a92ae397cbcd7ab91266 21-Jun-2017 Stephen Chen <stewchen@google.com> WifiNetworkSelector: cache filtered scan results

The filtered scan results removes the need to check for blacklisted
bssids, low signal strength, and invalid SSIDs before showing ONA
notifications.

Exempt-From-Owner-Approval: Owners file out of date
Bug: 37357441
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I5ac71fa366c8c45377857c18f392aa34d9cbd88f
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
60bc5b759aac3c5a5270d6406c133ab00c32f3a4 16-Jun-2017 Rajeev Kumar <rajekumar@google.com> Add error handling to
WifiConnectivityManager$PnoScanListener.onPnoNetworkFound method to skip
the scan results with null information elements.
Bug: 62540222

Change-Id: Ia631e21007cebdbab893f733d51ec06aded1f43c
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
05a9a73b519a68ee7def7472dad6c6570f2fed86 02-Jun-2017 Ningyuan Wang <nywang@google.com> Merge changes from topic 'supplicant_sta_iface_hal_network_change' into oc-dev am: 9da08e0146
am: 7e1def214f

Change-Id: Icf6dcc740c6fd9ed31fbf038f5d7e714b1b9fd3c
403df479e25031276c738dbea334f09bb7e4bf37 18-May-2017 Ningyuan Wang <nywang@google.com> Remove network from supplicant when it is disabled

This CL expands OnSavedNetworkUpdateListener interface by
replacing onSavedNetworkUpdate() event with a list of
detailed events.
This CL also removes a network from supplicant when it's
disabled.

Bug: 37406637
Test: compile, unit tests, manual tests, integration test

Change-Id: Idfa29cd15b8ad75de3bb7448abd7f3c93f9778f0
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
a570580925407f8e01358a5b2f0f9f611a77b0c2 25-May-2017 Roshan Pius <rpius@google.com> WCM: Remove unnecessary usage of |Long|

Bug: 28860433
Test: Unit tests
Change-Id: Ie5d676b1bcd698f50e2f08c6c5ae21353d35b5d7
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
e1fcc9d881760bf9926fc1e4b988a5a661218575 05-May-2017 Peter Qiu <zqiu@google.com> hotspot2: use system feature flag to guard Passpoint APIs

A system feature flag FEATURE_WIFI_PASSPOINT is added for
indicating Passpoint support. So use it to guard the Passpoint
APIs.

Bug: 36886243
Test: Manual test
Change-Id: Idbcf3e5ec4df929210b8694c52b966e14da04daa
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
25a5dee0ddf8b6b93f5cd37399eca5b4ba78565d 26-Apr-2017 Randy Pan <zpan@google.com> WifiConnectivityManager: logging improvement

1) Convert Wifi state information from integer to string.
2) Deleted the messages that indicate scans were successfully
scheduled.
3) Deleted the onPnoNetworkFound() message as handleScanResults()
already logs the listener name.
3) Cleaned up a couple of messages related to watchdog and
scan band settings.

Bug: 36872201
Test: Load the image, run connection tests and check the BR.
Change-Id: I8eee28399b38cc4efa3b39c4c13e7f600993d09b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
f14e4b8fdd949b4ba0feb63dded4d9b233859300 15-Apr-2017 Amin Shaikh <ashaikh@google.com> Create ScoredNetworkEvaluator.

- Bring back WifiNetworkScoreCache into the wifi framework
- Replace RecommendedNetworkEvaluator with ScoredNetworkEvalutor, which
is the same as the previous ExternalScoreEvaluator (ag/1865733) with some
changes:
* Check whether a ScanResult matches the current network by comparing
the matching WifiConfiguration instead of the current bssid
* Only create untrusted WifiConfigurations for open networks
* Set candidate ScanResults for all WifiConfigurations - not only the
final chosen WifiConfiguration
* Mark newly created ephemeral WifiConfiguration as enabled for network
selection
* Log a maximum of one LocalLog line per round of network selection

Bug: 37357981
Test: ./test/wifitests/runtests.sh
Change-Id: I99da4edb371928efb7ca7a9dcd28ddaca9209da8
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
96c4e4d724bd9e666adf177722eb7136ab340185 30-Mar-2017 Randy Pan <zpan@google.com> WifiConnectivityManager: Disable linked networks

Bug: 36786113
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I9f9294e29d8a6bb97e1822a6ffa0159a19e7a6ef
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
9af7a553d86c910a14410ddecea6fb9422c41cdb 20-Mar-2017 Peter Qiu <zqiu@google.com> hotspot2: add support for the build config flag "config_wifi_hotspot2_enabled"

This flag specifies if the Passpoint is enabled or not. Currently,
this flag is set to false for the default overlay.

So do not register PasspointNetworkEvaluator if Passpoint support
is not enabled to avoid any Passpoint related traffics (e.g. ANQP).
Also throw UnsupportedOperationException for any Passpoint related API
calls.

Bug: 32671424
Test: manual test
Change-Id: Icefa9b990d6d989750e5a7f00b4f3f5d83a82960
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
04c453c2e07efc30b99528926f205740226f1c7b 17-Feb-2017 Ningyuan Wang <nywang@google.com> Request Pno scan via wificond and re-enable pno scan

Bug: 32977707
Test: compile, unit tests, manual test, will do integration test

Change-Id: I3b7d5020aa695120a047a2d228fc6be5760e2343
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
805966beca772f5755be73ac1fe0819142ec294b 06-Dec-2016 Randy Pan <zpan@google.com> Blacklist AP immediately if its capacity is full

Blacklist a BSSID immediately when the association to it was
rejected because the AP cannot handle new stations. Previously
we treat all the association rejection the same and blacklist
the AP after 3 times of rejection.

Bug: 32745407
Test: Wifi framework unit tests
Change-Id: Ie64e7b2c659ee27d4cfa109b879d36fe836ee65b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
ff862e399bfdffc5c6d2d15acc75ae8cbadb5bde 01-Dec-2016 Rebecca Silberstein <silberst@google.com> WifiConnectivityManager: add dump call

Adding a dump call to WifiConnectivityManager (that passes through to
WifiNetworkSelector). The motivation for this change is to remove
the need to have another class to hold a reference to
WifiNetworkSelector (beyond WifiConnectivityManager) and will allow
the removal of getNetworkSelector from WifiInjector at a later date.

Bug: 33271805
Test: runtests.sh
Test: checked bugreport for NetworkSelector section
Change-Id: I948291a458946ae9d8b7e8fa87cf9936cc913dcf
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f174a7cfe941a9c2776440ee42e9a3300963260f 01-Nov-2016 Randy Pan <zpan@google.com> WCM & WNS: covert Log.x to LocalLog

Unify the logging mechanism so we always have a complete picture
of the WCM and WNS logs.

Bug: 32573962
Test: Build, flash and run.
Change-Id: I3a3d3f74ddcd6c999c8a43c49218bce6eab73213
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f2a46f11dd92f2820e96b1b8b69b433012d6bcef 03-Sep-2016 Randy Pan <zpan@google.com> Wifi Network Selector

Set up the layout of the new Wifi Network Selector. Add the implementation
of Save Network Evaluator and Exernally Scored Network Evaluator.

Bug: 31089538
Test: unit tests and manual tests
Merged-In: Ieb269060669df220c3d1777eb3aac3b119d4fdc1
Change-Id: Ieb269060669df220c3d1777eb3aac3b119d4fdc1
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
6259b630ddb59b642729a2d2113d81ed8e33a0e3 12-Sep-2016 Roshan Pius <rpius@google.com> WifiScanningService: Change hidden/PNO scan params

Since networks are no longer configured in wpa_supplicant, network
IDs/priorities being passed around for hidden/PNO scanning does not make
any sense. Changing the wifi scanner interface to remove all
network ID/priority references.

For hidden networks, we'll now send a sorted array of <ssid> for
each network (similar to PNO). This should help wificond prioritize
networks when the size exceed the max supported by driver.
Also, since wpa_supplicant already supports sending a list of ssids for
scanning, plumb it all the way through.

NOTE:
1. The backend for all these scans will eventually be replaced by
wificond.
2. Hidden networks are no longer considered in bgscan requests. This was
anyway not workin in HalWifiScanner's gscan backed bgscan.

BUG: 29503772
TEST: Existing unit tests.
TEST: Successfully connected to a hidden network on device
Change-Id: Ie7783353d2eb87c2fd7b9a10f44e3e5df4cbc218
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
59f9a74676831ba4634b35d56a1e2bbe9bf4e322 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
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
e4a3281e33c378ebfb64192612c7164e464809bb 20-Jul-2016 Randy Pan <zpan@google.com> WCM: reset last connection BSSID am: 179d479d04
am: 0caa4737e9

Change-Id: I53ff554c262fd0e2b3a61e19326ce80f7872436c
179d479d047c22d94d1db53980156986b0dba710 18-Jul-2016 Randy Pan <zpan@google.com> WCM: reset last connection BSSID

Reset WCM's record of last connection attempt BSSID when WiFi
is disconnected or WiFi/WCM is disabled.

Bug: 30140653
Tests: WiFi framework unit tests & manual tests
Change-Id: I70b285ffcc8783db587b3fcc14f8f85ffa6122f2
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
22b5eca14a99c2bbeeae8361c665923ce71e1603 28-Jun-2016 Roshan Pius <rpius@google.com> WifiConfigManagerNew: Scan results to config lookup

Add methods to perform:
1. Scan results to saved network lookup.
2. Cache the scan results for each saved network. Also, need to maintain
this list so that it doesn't grow uncontrolled.
3. Rename ScanDetailUtil to ScanResultUtil to accomodate scan result
helper classes for encryption type lookup.
4. Change ScanDetailCache to always trim the cache to the provided fixed
size.

While there,
Fix couple of checkstyle errors in the test.

BUG:29822168
TEST: Unit tests
Change-Id: I281ddcd606d73b8d04d6c9b33b9fc2d4f408f173
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
a3a7ae2fd2d82ffd0c352f5dfbee29c571ffc810 29-Jun-2016 Randy Pan <zpan@google.com> WCM: Fix a build error introduced by auto merger.

Change-Id: I808136d68263d0802fe0e00cc50d57fae3fcbe9b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
868f60b9bfbb394d113d50567da1977ec8afc890 29-Jun-2016 Randy Pan <zpan@google.com> WCM: periodic single scan timer cancellation am: ab7a54087b
am: 2fd7946753

Change-Id: Ied46e7767594bfa6a5040ef8338c9c17121f72f8
a384e26815f9a7edd760cbef9b92fb9925e9e5ca 29-Jun-2016 Randy Pan <zpan@google.com> resolve merge conflicts of fe51ea2 to master

Change-Id: I57d02ae2e0ecd7327e0be2ae5b0b5e3b43e43f70
ab7a54087b8c1874c7ca5e8b8da1faddbe1da0ce 22-Jun-2016 Randy Pan <zpan@google.com> WCM: periodic single scan timer cancellation

Cancel the periodic single scan timer only if it is started.

Bug: 28881202
Change-Id: I4d4936916daf2869bfda46476c7254a2b38e9a9b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
2352bf22557051e98eb16d087d20731e91cfdc71 28-Jun-2016 Randy Pan <zpan@google.com> WCM: track PNO scan state

Add a flag to track if PNO scan is started.

Bug: 29822923
Change-Id: I96416eb5a6590a52800b962838d2e87d9f52bb1a
Tests: Wifi Framework Unit Tests
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
8736bfe603ea5dd3f9499fa9b03520ff3d77bbc3 22-Jun-2016 Randy Pan <zpan@google.com> Merge "WCM: periodic single scan timer cancellation"
63c332be84b93f8e255a445ee9c95a6a1129788d 22-Jun-2016 Randy Pan <zpan@google.com> WCM: periodic single scan timer cancellation

Cancel the periodic single scan timer only if it is started.

Bug: 28881202
Change-Id: I4d4936916daf2869bfda46476c7254a2b38e9a9b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
c1a5efc53a277b68c72bc501f6ab68e266bb6cd1 20-Jun-2016 Randy Pan <zpan@google.com> Merge \\"Cut down Wifi local log buffers size\\" into nyc-mr1-dev am: 4301f4786e
am: 4a770e2e3f

Change-Id: Ibd4f5d9e77ddab7ea16ee4f9a8af736d601f9648
1e911c92133843fc0a50a1b1c6f654f62e7c98a8 17-Jun-2016 Randy Pan <zpan@google.com> Cut down Wifi local log buffers size

The new buffer size can hold up to around 3 hours of logs. This
can be further optimized later after we have more usage data.
The goal is to save the logs from the last one hour only.

Bug: 29179543
Change-Id: I99e15531328fdb03df28dcf5a014deb2f074b254
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f5dba8eb5e660932367fc650a2e2ca724df3734e 27-May-2016 Randy Pan <zpan@google.com> Reset single scan timestamp when disabling Wifi

This timestamp needs to be reset when WiFi is disabled. When WiFi
is enabled again, a connectivity scan starts immediately.
Otherwise it can be delayed because of the minimum periodic single
scan interval rule.

Bug: 28986330
Change-Id: I5a01dc267a05791eba34c87e6d9301bd998bf377
Tests: Wifi unit tests, manual test
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
3126f8d5394f8790e9c4ed4ab5c47fcc686e6803 25-May-2016 Randy Pan <zpan@google.com> Merge "Wifi: local log size reduction" into nyc-dev
15941215e85f924765f00779e9b5daff9ed6f118 24-May-2016 Randy Pan <zpan@google.com> Wifi: local log size reduction

Cut down the max number of lines allowed in Wifi LocalLogs.
Currently LocalLog checks the number of lines in its buffer
instead of total size in number of bytes. The buffer being
used can grow really big if some lines are lengthy.

Bug: 28865103
Change-Id: I7f77de1048bb465b79265b3ecb3a925e3a2659d9
Test: Wifi Framework Unit Tests
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
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
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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
ee9329dc901d59b8ae1e39edac99bd9d91306d2f 18-May-2016 Randy Pan <zpan@google.com> WifiConnectivityManager: partial scan only when connected

Starts partial scan only when Wifi is connected and traffic
is heavy. This is to work around an issue that WifiInfo
tx/rx rate is not updated to reflect the Wifi state. Ideally
the tx/rx rate should have been reset to 0 when Wifi is
disconnected.

Bug: 28831562
Change-Id: Ifa415b14e2b216654ddd8a2a0c885754da489bef
Test: Wifi Framework Unit Tests, manual tests
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
304d3451b9245f7c7bb5e81465561f0eb63b2473 16-May-2016 Randy Pan <zpan@google.com> WifiConfigManager: clean up makeChannelList()

Removed the unused input paramater 'restrict'. Updated its
callers.

Bug: 28786277
Change-Id: I44dc870ce3f353698187f76e8996cc77395b17d3
Tests: Wifi Framework Unit Tests, manual tests
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
46604d0d8d27c9dbdf986032de6e906e331f80ce 16-May-2016 Randy Pan <zpan@google.com> WifiStateMachine: clean up dead code

Cleaned up the dead code from the original exponential back off
scan implementation.

Bug: 28750989
Bug: 28070598

Change-Id: I8abf82cdaa3530fb514794b4004c5d3f15950672
Tests: Wifi Unit Tests, manual test
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
ae9e0ef3efdd579fab8d89b5c653f4069e7ac883 13-May-2016 Randy Pan <zpan@google.com> Restrict connectivty periodic scan

When the phone screen is on, the periodic scan interval is setup
in an exponential backoff fashion. Also, if the traffic is higher
than certain threshold, perform scan on certain channels only
instead of full band.

Bug: 28627603
Change-Id: I95b686d7835265d843edac7c005f661393ae5383
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
bacd0dca59fbba9f650a421a3d3b0dc5fa2eb606 04-May-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Increment metrics

Make changes to increment the watchdog related metrics in
WifiConnectivityManager.

PS: Will need to add mock alarm manager to add unit-tests here. This is
done in the next CL.

BUG: 27479439
BUG: 27704599
Change-Id: I96e35e06d222056ec29488666619486a65746b38
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
d54ddacc42d9cd929d40b1df391895293bacafe2 22-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Add stats for rate limiting

BUG: 28242396
Change-Id: I53c0e91d2b9ee2731c0f74ef6376f4fb4e67f2e9
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
4f5054647a2f4cac54a78d6e3bf3efa0727b488a 18-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Connection rate limit

Implement a rate limit for connection attempts to prevent us flapping
between networks.

While there,
Cleanup all the static time values to be more readable.

BUG: 28242396
Change-Id: I3e2476674e7239e000b93b95751acec3ea7bc8ce
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
7ce0f144104c68da40c196c16f73e2d0bcc50cc7 21-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Turn off ePno/Gscans

There is a lot of instability/unknowns for using ePno/Gscans for
connectivity purposes. Unless we've all of them hashed out, turn them
off.

BUG: 28300874
BUG: 28278197
Change-Id: Ifd650032237ac510687f0d374d31f7c9f13d18bd
TEST: Compiles & unit-test passes (Will send for ACTS testing).
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
14ef58beaf5c3ca9d3909ff67bbbc109521e29bf 19-Apr-2016 Roshan Pius <rpius@google.com> Merge "WifiConnectivityManager: Clear scan details after results" into nyc-dev
1e5ceb7ad228e29bf0f6b4706df49c684880c6e0 19-Apr-2016 Roshan Pius <rpius@google.com> Merge "WifiConnectivityManger: Enable background/ePNO scan" into nyc-dev
224198c8ba46f362a5df6d25f1b60e56f442b58b 18-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManager: Clear scan details after results

BUG: 28247321
Change-Id: I7913ae97ceb8566d7e0612455096362c661b6969
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
79e3bf8db6b566a5b3c7065cdd43f87f07e73747 08-Apr-2016 Roshan Pius <rpius@google.com> WifiConnectivityManger: Enable background/ePNO scan

Add a new flag to control both background scans & connected PNO scan in
WifiConnectivityManager (We may need to disable connected PNO even if we
enable gscan).
Also, change the disconnected PNO interval to 20 seconds.

BUG: 28020168
BUG: 27877781
Change-Id: I6e7224b02456573070a68dbe8f5a5b0d49f37fdc
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
33e62df1fd2d065f6d626d800350e2063978a0ab 15-Apr-2016 Glen Kuhne <kuh@google.com> Merge "Created LastResortWatchdog class" into nyc-dev
eeb1a3c3cb4c09f925496000392d63b2b28301f7 14-Apr-2016 Randy Pan <zpan@google.com> Condition on if the phone is connected to an AP

In addition to check if the BSSID of the candidate network
recommended by QNS matches the one tracked by WifiStateMachine's
WifiInfo, check if the phone is in one of the supplicant
connecting states. This is to take the fact that WifiInfo stores
a diconnected network's BSSID into count.

Bug: 28163444
Change-Id: I682bedc26e9f2ea34cb006b859384a8e414b047d
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
329b3a9a9bc32d14649e91c15876ea7f95f148d1 13-Apr-2016 Roshan Pius <rpius@google.com> WifiConfigManager: Remove dead code

BUG: 28164778
Change-Id: I1e09b8039dbf7d220fd699b5be3b29330d02a305
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
48444cb4214a48a3a0bf4bbb93945c2aa68c9980 01-Apr-2016 Mitchell Wills <mwills@google.com> Move single scan blaming from WifiStateMachine to WifiScanningService

Bug: 27247460
Change-Id: Id855329450659b8b762fcb0bf9dba5a0b551604e
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java
f37079e3d8f4aca3242a971cbaef732fe1b75bde 07-Apr-2016 Roshan Pius <rpius@google.com> WifiScanner: Remove pnosetting stopPno API (2/2)

BUG: 27532350
Change-Id: I291732cc693b6042ae995194094c4fec774dfbf1
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.java
466158a6669d51541ce6c5c4e04a71dad36cdb4e 01-Apr-2016 Randy Pan <zpan@google.com> Enable/disable WifiConnectivityManager at runtime

Add support to turn on and off WifiConnectivityManager at
runtime.

Bug: 27968625
Change-Id: I3583d1564a78a6db7227d2fa5a91e859cef83776
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiConnectivityManager.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/service/java/com/android/server/wifi/WifiConnectivityManager.java