summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2016-06-08 10:01:53 -0700
committerRandy Pan <zpan@google.com>2016-06-08 11:18:49 -0700
commita68f3e359ac27285b10332ea2461469e5e03bfd4 (patch)
tree02bf5c2e369e2653a76d1d11443224d360557e65 /service
parentad0d0a48952e025838992b6a1b0cd143f1915ced (diff)
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
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConnectivityManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index e6d285e96..078d48963 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -761,6 +761,12 @@ public class WifiConnectivityManager {
private void startPeriodicScan(boolean scanImmediately) {
mPnoScanListener.resetLowRssiNetworkRetryDelay();
+ // No connectivity scan if auto roaming is disabled.
+ if (mWifiState == WIFI_STATE_CONNECTED
+ && !mConfigManager.getEnableAutoJoinWhenAssociated()) {
+ return;
+ }
+
// Due to b/28020168, timer based single scan will be scheduled
// to provide periodic scan in an exponential backoff fashion.
if (!ENABLE_BACKGROUND_SCAN) {