summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNalla Kartheek <karthe@codeaurora.org>2016-01-06 18:23:23 +0530
committerSteve Kondik <steve@cyngn.com>2016-06-24 11:28:49 -1000
commite97c943330f18567161184d1a65842442a79983e (patch)
tree2b738c42aed7791d3587b5591cbb19789d0f05bf
parent22b3c71953adbf0db948efde921560bdeecfc1a4 (diff)
downloadandroid_frameworks_opt_net_wifi-e97c943330f18567161184d1a65842442a79983e.tar.gz
android_frameworks_opt_net_wifi-e97c943330f18567161184d1a65842442a79983e.tar.bz2
android_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
-rw-r--r--service/java/com/android/server/wifi/WifiConfigStore.java10
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 70f3a51ff..46250b3fd 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