diff options
author | Vinit Deshapnde <vinitd@google.com> | 2013-09-05 14:19:38 -0700 |
---|---|---|
committer | Vinit Deshapnde <vinitd@google.com> | 2013-09-05 14:19:38 -0700 |
commit | 1ed7a0200ac705b20f71193030a59edd8361200b (patch) | |
tree | dc4dc82c78f8fdf52685ecf274d738276a1e86db /wifi/java | |
parent | 2def61485413084e68233c89ba956a2282fbacd1 (diff) | |
download | frameworks_base-1ed7a0200ac705b20f71193030a59edd8361200b.zip frameworks_base-1ed7a0200ac705b20f71193030a59edd8361200b.tar.gz frameworks_base-1ed7a0200ac705b20f71193030a59edd8361200b.tar.bz2 |
Fix duplicate SSID entries in the WifiSettings UI
The root cause is likely our 'no networks' problem; it caused people
to add new (and duplicate) entries to their list of networks; which
are haunting us now.
This change looks up the dupes, and discards them, even if they came
wifi supplicant.
Bug: 10633813
Change-Id: I656b6bf7240de6763bf84b5b406c50444af6dd48
Diffstat (limited to 'wifi/java')
-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(); |