diff options
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfigStore.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfigStore.java b/wifi/java/android/net/wifi/WifiConfigStore.java index 4baab1f..ea7904c 100644 --- a/wifi/java/android/net/wifi/WifiConfigStore.java +++ b/wifi/java/android/net/wifi/WifiConfigStore.java @@ -680,9 +680,15 @@ class WifiConfigStore { } config.ipAssignment = IpAssignment.DHCP; config.proxySettings = ProxySettings.NONE; - mConfiguredNetworks.put(config.networkId, config); - mNetworkIds.put(configKey(config), config.networkId); - localLog("loaded configured network", config.networkId); + + if (mNetworkIds.containsKey(configKey(config))) { + // That SSID is already known, just ignore this duplicate entry + localLog("discarded duplicate network", config.networkId); + } else { + mConfiguredNetworks.put(config.networkId, config); + mNetworkIds.put(configKey(config), config.networkId); + localLog("loaded configured network", config.networkId); + } } readIpAndProxyConfigurations(); |