summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2016-07-22 16:18:43 -0700
committerRandy Pan <zpan@google.com>2016-07-25 11:56:36 -0700
commit828b94eca5e0ffa67448f67a9dfb4d7eb492312a (patch)
tree614b410fe5d7c9ba3b6e4f0948cdb29e69ce2b3b /service
parent58a8f2e0ac9894831dff6d7f18c9c92df6eda381 (diff)
downloadwifi-828b94eca5e0ffa67448f67a9dfb4d7eb492312a.tar.gz
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
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiQualifiedNetworkSelector.java5
1 files changed, 4 insertions, 1 deletions
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);
}
}