diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-04-24 01:34:34 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-24 01:34:34 +0000 |
commit | 956d2e9d46ffcb8f6f13bfd792bae6ca02549c06 (patch) | |
tree | 273b4b8f8885e65e53ce9d5edc31b4f64b734a50 /service | |
parent | cb3068db3169ab2c9645683fd7b5baeae1db7c7d (diff) | |
parent | bf5903c9c270c329aa2eaffcf777ce72752d7021 (diff) |
Merge "WifiNetworkFactory: Don't use WifiConfig from UI for matching" into rvc-dev am: bf5903c9c2
Change-Id: Iec1ee0a8800aa5fa340e7d26ee46df6e33509dad
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkFactory.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java index 26e602354..52fc0e5a7 100644 --- a/service/java/com/android/server/wifi/WifiNetworkFactory.java +++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java @@ -790,7 +790,9 @@ public class WifiNetworkFactory extends NetworkFactory { new WifiConfiguration(mActiveSpecificNetworkRequestSpecifier.wifiConfiguration); networkToConnect.SSID = network.SSID; // Set the WifiConfiguration.BSSID field to prevent roaming. - networkToConnect.BSSID = findBestBssidFromActiveMatchedScanResultsForNetwork(network); + networkToConnect.BSSID = + findBestBssidFromActiveMatchedScanResultsForNetwork( + ScanResultMatchInfo.fromWifiConfiguration(networkToConnect)); networkToConnect.ephemeral = true; // Mark it user private to avoid conflicting with any saved networks the user might have. // TODO (b/142035508): Use a more generic mechanism to fix this. @@ -1246,14 +1248,14 @@ public class WifiNetworkFactory extends NetworkFactory { // i) The latest scan results were empty. // ii) The latest scan result did not contain any BSSID for the SSID user chose. private @Nullable String findBestBssidFromActiveMatchedScanResultsForNetwork( - @NonNull WifiConfiguration network) { + @NonNull ScanResultMatchInfo scanResultMatchInfo) { if (mActiveSpecificNetworkRequestSpecifier == null || mActiveMatchedScanResults == null) return null; ScanResult selectedScanResult = mActiveMatchedScanResults .stream() .filter(scanResult -> Objects.equals( ScanResultMatchInfo.fromScanResult(scanResult), - ScanResultMatchInfo.fromWifiConfiguration(network))) + scanResultMatchInfo)) .max(Comparator.comparing(scanResult -> scanResult.level)) .orElse(null); if (selectedScanResult == null) { // Should never happen. |