summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiConfigStore.java
diff options
context:
space:
mode:
Diffstat (limited to 'service/java/com/android/server/wifi/WifiConfigStore.java')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigStore.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java
index 30f0e6c96..8107d1ac9 100644
--- a/service/java/com/android/server/wifi/WifiConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiConfigStore.java
@@ -2323,7 +2323,7 @@ public class WifiConfigStore extends IpConfigStore {
if (key.equals(CONFIG_KEY)) {
config = mConfiguredNetworks.getByConfigKey(value);
-
+
// skip reading that configuration data
// since we don't have a corresponding network ID
if (config == null) {
@@ -4210,6 +4210,38 @@ public class WifiConfigStore extends IpConfigStore {
return found;
}
+ /**
+ * Handle blacklisting per BSSID and unblacklisting
+ *
+ * @param enable
+ * @param BSSID
+ * @param reason
+ */
+ void handleDisabledAPs( boolean enable, String BSSID, int reason) {
+ if (BSSID == null)
+ return;
+ for (WifiConfiguration config : mConfiguredNetworks.values()) {
+ if (getScanDetailCache(config) != null) {
+ for (ScanDetail scanDetail : getScanDetailCache(config).values()) {
+ if (scanDetail.getBSSIDString().equals(BSSID)) {
+ if (enable) {
+ config.BSSID = "any";
+ scanDetail.getScanResult().setAutoJoinStatus(ScanResult.ENABLED);
+ // enable auto join for the blacklisted BSSID
+ config.setAutoJoinStatus(WifiConfiguration.AUTO_JOIN_ENABLED);
+ } else {
+ // blacklist only the specified BSSID
+ scanDetail.getScanResult().setAutoJoinStatus(ScanResult.AUTO_ROAM_DISABLED);
+ config.BSSID = BSSID;
+ config.setAutoJoinStatus(WifiConfiguration.AUTO_JOIN_TEMPORARY_DISABLED);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
int getMaxDhcpRetries() {
return Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.WIFI_MAX_DHCP_RETRY_COUNT,