From c17a63eddba6d339cccddb65416a209e889c148c Mon Sep 17 00:00:00 2001 From: Nalla Kartheek Date: Wed, 3 Feb 2016 14:13:15 +0530 Subject: Wifi: Unblacklist the BSSIDs, if driver roams to the same again. Auto join black list the connected BSSIDs, if driver roams away from it. This shall result in the respective BSSID getting blacklisted for the next strategy. Enhance this logic by un blacklisting such BSSID's if the driver has roamed again. This goes with our logic that - driver roaming to such BSSID again should indicate to the framework that the BSSID is the best in the network. Change-Id: I24bf6caeb9a9277db577d0870e6961609ebf7677 CRs-Fixed: 968421 --- .../java/com/android/server/wifi/WifiConfigStore.java | 18 ++++++++++++++++++ .../java/com/android/server/wifi/WifiStateMachine.java | 1 + 2 files changed, 19 insertions(+) (limited to 'service/java') diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index b8701b7..61f31f3 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -1156,6 +1156,24 @@ public class WifiConfigStore extends IpConfigStore { } } + void unblackListDriverRoamedBSSID(String bssid) { + for (WifiConfiguration config : mConfiguredNetworks.values()) { + ScanDetailCache cache = getScanDetailCache(config); + if (cache != null) { + ScanResult result = cache.get(bssid); + if (result != null) { + if (result.autoJoinStatus == (ScanResult.AUTO_ROAM_DISABLED + 1)) { + if (DBG) { + Log.d(TAG,"unblacklisted driver roamed BSSID = "+result.BSSID); + } + result.setAutoJoinStatus(ScanResult.ENABLED); + } + } + } + } + } + + void noteRoamingFailure(WifiConfiguration config, int reason) { if (config == null) return; config.lastRoamingFailure = System.currentTimeMillis(); diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 20a549d..58e7841 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -9411,6 +9411,7 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno if (toBSSID != null && !toBSSID.equals(mWifiInfo.getBSSID())) { mWifiConfigStore.driverRoamedFrom(mWifiInfo); } + mWifiConfigStore.unblackListDriverRoamedBSSID(toBSSID); return NOT_HANDLED; case WifiMonitor.NETWORK_DISCONNECTION_EVENT: long lastRoam = 0; -- cgit v1.2.3