diff options
author | Nalla Kartheek <karthe@codeaurora.org> | 2016-01-06 18:23:23 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-06-24 11:28:49 -1000 |
commit | e97c943330f18567161184d1a65842442a79983e (patch) | |
tree | 2b738c42aed7791d3587b5591cbb19789d0f05bf /service/java | |
parent | 22b3c71953adbf0db948efde921560bdeecfc1a4 (diff) | |
download | frameworks_opt_net_wifi-e97c943330f18567161184d1a65842442a79983e.tar.gz frameworks_opt_net_wifi-e97c943330f18567161184d1a65842442a79983e.tar.bz2 frameworks_opt_net_wifi-e97c943330f18567161184d1a65842442a79983e.zip |
Don't create ScanDetailCache if entry absent in mScanDetailCaches
Framework checks ScanDetailCache for particular network entry based on
network id. If entry absent, it will create fresh object for
ScanDetailCache. Later if another network is added with same network id,
getScanDetailCache returns the old network entry, this leads to SSID
mismatch issues.
Hence while updating saved networks history do not create fresh object.
Change-Id: Ibcc9aa600795bd5c141b3f4c52c46cc7ea6dd963
CRs-Fixed: 956970
Diffstat (limited to 'service/java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigStore.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index 70f3a51..46250b3 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -2342,8 +2342,8 @@ public class WifiConfigStore extends IpConfigStore { out.writeUTF(DEFAULT_GW_KEY + SEPARATOR + macAddress + NL); } - if (getScanDetailCache(config) != null) { - for (ScanDetail scanDetail : getScanDetailCache(config).values()) { + if (getScanDetailCacheIfExist(config) != null) { + for (ScanDetail scanDetail : getScanDetailCacheIfExist(config).values()) { ScanResult result = scanDetail.getScanResult(); out.writeUTF(BSSID_KEY + SEPARATOR + result.BSSID + NL); @@ -3339,6 +3339,12 @@ public class WifiConfigStore extends IpConfigStore { return cache; } + public ScanDetailCache getScanDetailCacheIfExist(WifiConfiguration config) { + if (config == null) return null; + return mScanDetailCaches.get(config.networkId); + } + + /** * This function run thru the Saved WifiConfigurations and check if some should be linked. * @param config |