summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlen Kuhne <kuh@google.com>2016-03-21 11:30:03 -0700
committerGlen Kuhne <kuh@google.com>2016-03-22 09:17:32 -0700
commit0f179857cae968ee9a5bdae47a4ec914dea08f1d (patch)
treeab3e516a6796cf075fd1a917c5d960802bf04247
parent5ed43368643dab64c83bfb15e14ab59d63645c6f (diff)
Fix Roaming between Dual-Band SSIDs on same router
Fixed CMD_AUTO_ROAM so that it actually uses the network ID & associated config of the target, rather than always assuming roams are to the same networkID & config as the previous connection. BUG=27358522 Change-Id: I3ec6fae9cb45cd62a7afc8d48ac5a0b29d93f87c
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java36
1 files changed, 20 insertions, 16 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 3cd2378ba..275f486c4 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -8177,13 +8177,12 @@ public class WifiStateMachine extends StateMachine implements WifiNative.PnoEven
if (candidate != null) {
bssid = candidate.BSSID;
}
- int netId = mLastNetworkId;
- config = getCurrentWifiConfiguration();
-
-
- if (config == null) {
+ int netId = message.arg1;
+ if (netId == WifiConfiguration.INVALID_NETWORK_ID) {
loge("AUTO_ROAM and no config, bail out...");
break;
+ } else {
+ config = mWifiConfigManager.getWifiConfiguration(netId);
}
logd("CMD_AUTO_ROAM sup state "
@@ -8197,17 +8196,22 @@ public class WifiStateMachine extends StateMachine implements WifiNative.PnoEven
setTargetBssid(config, bssid);
mTargetNetworkId = netId;
- mWifiMetrics.startConnectionEvent(config, mTargetRoamBSSID,
- WifiMetricsProto.ConnectionEvent.ROAM_ENTERPRISE);
- /* <TODO> 2016-02-24
- Detect DBDC (2.4 <-> 5Ghz, same AP) roaming events, once CMD_AUTO_ROAM
- has been fixed to handle them correctly:
- mWifiMetrics.setConnectionEventRoamType(
- WifiMetricsProto.ConnectionEvent.ROAM_DBDC);
- Handy statements:
- ABSSID.regionMatches(true, 0, BBSSID, 0, 16) //BSSID matching
- currentConfig.isLinked(config) //check the configs are linked
- */
+
+ /* Determine if this is a regular roam (between BSSIDs sharing the same SSID),
+ or a DBDC roam (between 2.4 & 5GHz networks on different SSID's, but with
+ matching 16 byte BSSID prefixes):
+ */
+ WifiConfiguration currentConfig = getCurrentWifiConfiguration();
+ if (currentConfig != null && currentConfig.isLinked(config)) {
+ // This is dual band roaming
+ mWifiMetrics.startConnectionEvent(config, mTargetRoamBSSID,
+ WifiMetricsProto.ConnectionEvent.ROAM_DBDC);
+ } else {
+ // This is regular roaming
+ mWifiMetrics.startConnectionEvent(config, mTargetRoamBSSID,
+ WifiMetricsProto.ConnectionEvent.ROAM_ENTERPRISE);
+ }
+
if (deferForUserInput(message, netId, false)) {
mWifiMetrics.endConnectionEvent(
WifiMetrics.ConnectionEvent.FAILURE_CONNECT_NETWORK_FAILED,