diff options
author | Roshan Pius <rpius@google.com> | 2016-11-22 14:16:38 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2016-11-29 02:32:13 +0000 |
commit | eb77c40b3d17153fe91ca1691aaf2ad16f3f7267 (patch) | |
tree | cd0da6b7defa27e6e432082dd569527e4042c94b /service | |
parent | 3da163761890870f03c3df95e1e0a315c5068e44 (diff) | |
download | android_frameworks_opt_net_wifi-eb77c40b3d17153fe91ca1691aaf2ad16f3f7267.tar.gz android_frameworks_opt_net_wifi-eb77c40b3d17153fe91ca1691aaf2ad16f3f7267.tar.bz2 android_frameworks_opt_net_wifi-eb77c40b3d17153fe91ca1691aaf2ad16f3f7267.zip |
DO NOT MERGE: WifiConfigManager: Ignore disabled networks in PNO list
These networks are not connectable even if they're detected by PNO
scans. So, ignore them in the PNO list.
Bug: 33055484
Test: Integration tests
Change-Id: I3a33e0444639969195506321f630430520bbfcd5
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigManager.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 3c717c0ed..0cc0c9fca 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -94,6 +94,7 @@ import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; @@ -1123,6 +1124,14 @@ public class WifiConfigManager { ArrayList<WifiScanner.PnoSettings.PnoNetwork> pnoList = new ArrayList<>(); ArrayList<WifiConfiguration> wifiConfigurations = new ArrayList<>(mConfiguredNetworks.valuesForCurrentUser()); + // Remove any permanently disabled networks. + Iterator<WifiConfiguration> iter = wifiConfigurations.iterator(); + while (iter.hasNext()) { + WifiConfiguration config = iter.next(); + if (config.getNetworkSelectionStatus().isNetworkPermanentlyDisabled()) { + iter.remove(); + } + } Collections.sort(wifiConfigurations, pnoListComparator); // Let's use the network list size as the highest priority and then go down from there. // So, the most frequently connected network has the highest priority now. |