summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiNetworkFactory.java
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-11-01 12:54:23 -0700
committerRoshan Pius <rpius@google.com>2018-11-16 12:10:31 -0800
commitb378580253db6c2671a735da2c27abd5228e63cf (patch)
tree0235a909681733ca2e893dfa7990210672837db5 /service/java/com/android/server/wifi/WifiNetworkFactory.java
parentea2711baef165448c172c45d4cf68fb9b95a081c (diff)
downloadandroid_frameworks_opt_net_wifi-b378580253db6c2671a735da2c27abd5228e63cf.tar.gz
android_frameworks_opt_net_wifi-b378580253db6c2671a735da2c27abd5228e63cf.tar.bz2
android_frameworks_opt_net_wifi-b378580253db6c2671a735da2c27abd5228e63cf.zip
WifiConnectivityManager: Refactor auto-join enable/disable
There are 3 factors which decide whether auto-join is enabled or not: a) No specific network request in progress, AND b.1) At-least one pending generic trusted network request. OR b.2) At-least one pending generic untrusted network request. Bug: 113878056 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I13e0594ff1e28be42a8c992544bdac94bace9051
Diffstat (limited to 'service/java/com/android/server/wifi/WifiNetworkFactory.java')
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkFactory.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java
index 9da64d231..aa9fbdfff 100644
--- a/service/java/com/android/server/wifi/WifiNetworkFactory.java
+++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java
@@ -326,7 +326,7 @@ public class WifiNetworkFactory extends NetworkFactory {
startPeriodicScans();
// Disable Auto-join so that NetworkFactory can take control of the network selection.
// TODO(b/117979585): Defer turning off auto-join.
- mWifiConnectivityManager.enable(false);
+ mWifiConnectivityManager.setSpecificNetworkRequestInProgress(true);
}
}
@@ -357,10 +357,8 @@ public class WifiNetworkFactory extends NetworkFactory {
mActiveSpecificNetworkRequestSpecifier = null;
// Cancel the periodic scans.
cancelPeriodicScans();
- // Re-enable Auto-join (if there is a generic request pending).
- if (mGenericConnectionReqCount > 0) {
- mWifiConnectivityManager.enable(true);
- }
+ // Re-enable Auto-join.
+ mWifiConnectivityManager.setSpecificNetworkRequestInProgress(false);
}
}