diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ConfigurationMap.java | 8 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigManager.java | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/ConfigurationMap.java b/service/java/com/android/server/wifi/ConfigurationMap.java index 1f21891e3..a050b9cd8 100644 --- a/service/java/com/android/server/wifi/ConfigurationMap.java +++ b/service/java/com/android/server/wifi/ConfigurationMap.java @@ -49,8 +49,12 @@ public class ConfigurationMap { if (config.shared || currentUser.equals(creatorUser) || mUserManager.isSameProfileGroup(currentUser, creatorUser)) { mPerIDForCurrentUser.put(config.networkId, config); - mScanResultMatchInfoMapForCurrentUser.put( - ScanResultMatchInfo.fromWifiConfiguration(config), config); + // TODO (b/142035508): Add a more generic fix. This cache should only hold saved + // networks. + if (!config.fromWifiNetworkSpecifier) { + mScanResultMatchInfoMapForCurrentUser.put( + ScanResultMatchInfo.fromWifiConfiguration(config), config); + } } return current; } diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 209044a65..d607b7893 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -2364,6 +2364,9 @@ public class WifiConfigManager { * @param scanDetail ScanDetail instance to use for looking up the network. * @return WifiConfiguration object representing the network corresponding to the scanDetail, * null if none exists. + * + * TODO (b/142035508): This should only return saved networks (and rename to + * getSavedNetworkForScanDetail()). */ public WifiConfiguration getConfiguredNetworkForScanDetail(ScanDetail scanDetail) { ScanResult scanResult = scanDetail.getScanResult(); @@ -2391,6 +2394,8 @@ public class WifiConfigManager { * {@link #mScanDetailCaches} for the retrieved network. * * @param scanDetail input a scanDetail from the scan result + * TODO (b/142035508): This should only return saved networks (and rename to + * updateScanDetailCacheFromScanDetail()). */ public void updateScanDetailCacheFromScanDetail(ScanDetail scanDetail) { WifiConfiguration network = getConfiguredNetworkForScanDetail(scanDetail); @@ -2407,6 +2412,8 @@ public class WifiConfigManager { * @param scanDetail input a scanDetail from the scan result * @return WifiConfiguration object representing the network corresponding to the scanDetail, * null if none exists. + * TODO (b/142035508): This should only return saved networks (and rename to + * getSavedNetworkForScanDetailAndCache()). */ public WifiConfiguration getConfiguredNetworkForScanDetailAndCache(ScanDetail scanDetail) { WifiConfiguration network = getConfiguredNetworkForScanDetail(scanDetail); |