summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2017-03-02 16:05:11 -0800
committerRandy Pan <zpan@google.com>2017-03-28 12:00:07 -0700
commitc22ad7f19888f7967edcf30080543bb632ddd68d (patch)
treec801fd447a0ee57bb326c40a9c33814a43b572cf /service
parent17c2a7b30e5680b11fc0073ce322ee7bc14ef2c5 (diff)
Same BSSID award
When firmware roaming is supported, apply the same BSSID award to all of the BSSIDs under the same network as the currently connected BSSID. This is under the assumption that firmware will roam to that better BSSID. This might save a disconnection triggered by network switch when the score of the currently connected BSSID is lower than a network with a different SSID, but within the currently connected network there is a BSSID better than the currently connected BSSID. Bug: 35642269 Test: runtest.sh Change-Id: Ie09170d0cb11565f72e3b45b702d39c88ababba9
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/SavedNetworkEvaluator.java16
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java2
2 files changed, 15 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/SavedNetworkEvaluator.java b/service/java/com/android/server/wifi/SavedNetworkEvaluator.java
index ff880f510..f70d12d1d 100644
--- a/service/java/com/android/server/wifi/SavedNetworkEvaluator.java
+++ b/service/java/com/android/server/wifi/SavedNetworkEvaluator.java
@@ -41,6 +41,7 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat
private final WifiConfigManager mWifiConfigManager;
private final Clock mClock;
private final LocalLog mLocalLog;
+ private final WifiConnectivityHelper mConnectivityHelper;
private final int mRssiScoreSlope;
private final int mRssiScoreOffset;
private final int mSameBssidAward;
@@ -54,10 +55,12 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat
private boolean mCurateSavedOpenNetworks;
SavedNetworkEvaluator(final Context context, WifiConfigManager configManager, Clock clock,
- LocalLog localLog, Looper looper, final FrameworkFacade frameworkFacade) {
+ LocalLog localLog, Looper looper, final FrameworkFacade frameworkFacade,
+ WifiConnectivityHelper connectivityHelper) {
mWifiConfigManager = configManager;
mClock = clock;
mLocalLog = localLog;
+ mConnectivityHelper = connectivityHelper;
mRssiScoreSlope = context.getResources().getInteger(
R.integer.config_wifi_framework_RSSI_SCORE_SLOPE);
@@ -205,13 +208,22 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat
score += mSameNetworkAward;
sbuf.append(" Same network the current one bonus: ")
.append(mSameNetworkAward).append(",");
+
+ // When firmware roaming is supported, equivalent BSSIDs (the ones under the
+ // same network as the currently connected one) get the same BSSID award.
+ if (mConnectivityHelper.isFirmwareRoamingSupported()
+ && currentBssid != null && !currentBssid.equals(scanResult.BSSID)) {
+ score += mSameBssidAward;
+ sbuf.append(" Firmware roaming equivalent BSSID bonus: ")
+ .append(mSameBssidAward).append(",");
+ }
}
// Same BSSID award.
if (currentBssid != null && currentBssid.equals(scanResult.BSSID)) {
score += mSameBssidAward;
sbuf.append(" Same BSSID as the current one bonus: ").append(mSameBssidAward)
- .append(",");
+ .append(",");
}
// Security award.
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index 5fa0ee9ac..af470eee8 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -200,7 +200,7 @@ public class WifiInjector {
mConnectivityLocalLog);
mSavedNetworkEvaluator = new SavedNetworkEvaluator(mContext,
mWifiConfigManager, mClock, mConnectivityLocalLog, wifiStateMachineLooper,
- mFrameworkFacade);
+ mFrameworkFacade, mWifiConnectivityHelper);
mRecommendedNetworkEvaluator = new RecommendedNetworkEvaluator(context,
context.getContentResolver(), wifiStateMachineLooper, mFrameworkFacade,
mNetworkScoreManager, mWifiConfigManager, mConnectivityLocalLog);