diff options
author | Nalla Kartheek <karthe@codeaurora.org> | 2016-01-25 14:15:59 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-06-24 11:28:49 -1000 |
commit | f995ef76eddb30e5c12a902453c229688d0b78a5 (patch) | |
tree | 2cb26558368ccbb9f1bc45d0cfe03a5d618df46d | |
parent | c06efae309a47fe7cd22d0b1dcb616112e1b5be0 (diff) | |
download | android_frameworks_opt_net_wifi-f995ef76eddb30e5c12a902453c229688d0b78a5.tar.gz android_frameworks_opt_net_wifi-f995ef76eddb30e5c12a902453c229688d0b78a5.tar.bz2 android_frameworks_opt_net_wifi-f995ef76eddb30e5c12a902453c229688d0b78a5.zip |
Wifi : Add null check before accessing ScanDetailCache
getScanDetailCacheIfExist function shall return null if the configuration
is obsent in mScanDetailCaches. Due to synchronization issue in
writeKnownNetworkHistory function, it is required to add null check in all
the places.
Change-Id: Id6b7ee9601e4fe9a4d99f87222e4026d11903e2b
CRs-Fixed: 966542
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigStore.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index ec635f289..b8701b776 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -2342,8 +2342,9 @@ public class WifiConfigStore extends IpConfigStore { out.writeUTF(DEFAULT_GW_KEY + SEPARATOR + macAddress + NL); } - if (getScanDetailCacheIfExist(config) != null) { - for (ScanDetail scanDetail : getScanDetailCacheIfExist(config).values()) { + ScanDetailCache cache = getScanDetailCacheIfExist(config); + if (cache != null) { + for (ScanDetail scanDetail : cache.values()) { ScanResult result = scanDetail.getScanResult(); out.writeUTF(BSSID_KEY + SEPARATOR + result.BSSID + NL); |