diff options
author | Xiao Ma <xiaom@google.com> | 2020-03-16 04:24:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-16 04:24:57 +0000 |
commit | f49ecdc225cd7d1b8fde7fb1d4048adb55ee7fae (patch) | |
tree | a7ba77f117ed30701dcc69cb2a93fa1718cc3675 | |
parent | 43928f3b36df2287b4f512969b418188cf3b2d44 (diff) | |
parent | ec3264870af96b469b4f65fd843ff8f9cc4d1098 (diff) |
Merge "Update method of getting ScanResult of current network." into rvc-dev
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index be3b3132c..004437d2e 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -6387,8 +6387,25 @@ public class ClientModeImpl extends StateMachine { ScanDetailCache scanDetailCache = mWifiConfigManager.getScanDetailCacheForNetwork(config.networkId); ScanResult scanResult = null; - if (scanDetailCache != null && mLastBssid != null) { - scanResult = scanDetailCache.getScanResult(mLastBssid); + if (mLastBssid != null) { + if (scanDetailCache != null) { + scanResult = scanDetailCache.getScanResult(mLastBssid); + } + + // The cached scan result of connected network would be null at the first + // connection, try to check full scan result list again to look up matched + // scan result associated to the current SSID and BSSID. + if (scanResult == null) { + ScanRequestProxy scanRequestProxy = mWifiInjector.getScanRequestProxy(); + List<ScanResult> scanResults = scanRequestProxy.getScanResults(); + for (ScanResult result : scanResults) { + if (result.SSID.equals(WifiInfo.removeDoubleQuotes(config.SSID)) + && result.BSSID.equals(mLastBssid)) { + scanResult = result; + break; + } + } + } } final ProvisioningConfiguration prov; |