summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkSelector.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkSelector.java b/service/java/com/android/server/wifi/WifiNetworkSelector.java
index 50078b628..fbbcb3174 100644
--- a/service/java/com/android/server/wifi/WifiNetworkSelector.java
+++ b/service/java/com/android/server/wifi/WifiNetworkSelector.java
@@ -462,6 +462,17 @@ public class WifiNetworkSelector {
return validScanDetails;
}
+ private ScanDetail findScanDetailForBssid(List<ScanDetail> scanDetails,
+ String currentBssid) {
+ for (ScanDetail scanDetail : scanDetails) {
+ ScanResult scanResult = scanDetail.getScanResult();
+ if (scanResult.BSSID.equals(currentBssid)) {
+ return scanDetail;
+ }
+ }
+ return null;
+ }
+
private boolean isEnhancedOpenSupported() {
if (mIsEnhancedOpenSupportedInitialized) {
return mIsEnhancedOpenSupported;
@@ -790,6 +801,8 @@ public class WifiNetworkSelector {
WifiCandidates.Key key = new WifiCandidates.Key(
ScanResultMatchInfo.fromWifiConfiguration(currentNetwork),
bssid, currentNetwork.networkId);
+ ScanDetail scanDetail = findScanDetailForBssid(mFilteredNetworks, currentBssid);
+ int predictedTputMbps = (scanDetail == null) ? 0 : predictThroughput(scanDetail);
wifiCandidates.add(key, currentNetwork,
NetworkNominator.NOMINATOR_ID_CURRENT,
wifiInfo.getRssi(),
@@ -797,7 +810,7 @@ public class WifiNetworkSelector {
calculateLastSelectionWeight(currentNetwork.networkId),
WifiConfiguration.isMetered(currentNetwork, wifiInfo),
isFromCarrierOrPrivilegedApp(currentNetwork),
- 0 /* Mbps */);
+ predictedTputMbps);
}
for (NetworkNominator registeredNominator : mNominators) {
localLog("About to run " + registeredNominator.getName() + " :");