summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-04-24 01:25:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-24 01:25:22 +0000
commitbf5903c9c270c329aa2eaffcf777ce72752d7021 (patch)
treea296570e8f335cc9dfad9b8f7bfd2ec331daca95 /service
parent964bd5d117391df9428d806f182c542cc75c1ca4 (diff)
parente0e4592a0efe0170ad5a5e162253306f7d0f21fc (diff)
Merge "WifiNetworkFactory: Don't use WifiConfig from UI for matching" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkFactory.java8
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.