From 828b94eca5e0ffa67448f67a9dfb4d7eb492312a Mon Sep 17 00:00:00 2001 From: Randy Pan Date: Fri, 22 Jul 2016 16:18:43 -0700 Subject: QNS: candidate network BSSID QNS recommends a network for WCM to connect or roam to by returning that network's configuration with the BSSID stored in the 'candidate' field. In a corner case that if 1) two APs are within the same network (SSID), 2) the two APs get exactly the same QNS score (one AP has higher RSSI value but 2.4GHz, and the other is 5GHz but lower RSSI), and 3) the 5GHz AP shows up in the scan results before the 2.4GHz AP, QNS sets the wrong BSSID value. This change fixes that problem. Bug: 30184472 Change-Id: I8c67ab194571ba17b853eae617fb659017f72969 Test: WiFi Framework Unit Tests & manual tests --- .../java/com/android/server/wifi/WifiQualifiedNetworkSelector.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiQualifiedNetworkSelector.java b/service/java/com/android/server/wifi/WifiQualifiedNetworkSelector.java index ff8b7f684..ee7397a36 100644 --- a/service/java/com/android/server/wifi/WifiQualifiedNetworkSelector.java +++ b/service/java/com/android/server/wifi/WifiQualifiedNetworkSelector.java @@ -781,7 +781,9 @@ public class WifiQualifiedNetworkSelector { potentialCandidate = network; } //update the cached candidate - if (score > status.getCandidateScore()) { + if (score > status.getCandidateScore() || (score == status.getCandidateScore() + && status.getCandidate() != null + && scanResult.level > status.getCandidate().level)) { status.setCandidate(scanResult); status.setCandidateScore(score); } @@ -795,6 +797,7 @@ public class WifiQualifiedNetworkSelector { currentHighestScore = highestScore; scanResultCandidate = scanResult; networkCandidate = configurationCandidateForThisScan; + networkCandidate.getNetworkSelectionStatus().setCandidate(scanResultCandidate); } } -- cgit v1.2.3