diff options
author | Paul Stewart <pstew@google.com> | 2016-12-03 04:17:53 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-12-03 04:17:53 +0000 |
commit | 6cc31d8ca94e61193a27b395282defeed33cf7be (patch) | |
tree | ee9760e1a46301023cfd14fcb6ab9a9834918314 | |
parent | 8bb86aa62255c646f897d59b5eed3bb9e16f5d22 (diff) | |
parent | f229afcd54fc31eaf0f66cfb9e548cfc49d689e1 (diff) |
Upgrade WPA/EAP connections to their fast-transition equivalent
am: f229afcd54
Change-Id: I80ba13a82c3da0a6f760df08de2540243f6a9d40
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 4 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiSupplicantControl.java | 36 |
2 files changed, 38 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 548fd6b2a..7e42f99f2 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -877,6 +877,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss mWifiConfigManager = mWifiInjector.getWifiConfigManager(); mWifiSupplicantControl = mWifiInjector.getWifiSupplicantControl(); + mWifiSupplicantControl.setSystemSupportsFastBssTransition( + mContext.getResources().getBoolean(R.bool.config_wifi_fast_bss_transition_enabled)); mPasspointManager = mWifiInjector.getPasspointManager(); @@ -2099,6 +2101,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss pw.println("mUserWantsSuspendOpt " + mUserWantsSuspendOpt); pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled); pw.println("Supplicant status " + mWifiNative.status(true)); + pw.println("mSystemSupportsFastBssTransition " + + mWifiSupplicantControl.getSystemSupportsFastBssTransition()); if (mCountryCode.getCountryCodeSentToDriver() != null) { pw.println("CountryCode sent to driver " + mCountryCode.getCountryCodeSentToDriver()); } else { diff --git a/service/java/com/android/server/wifi/WifiSupplicantControl.java b/service/java/com/android/server/wifi/WifiSupplicantControl.java index 0109e402b..6507beda2 100644 --- a/service/java/com/android/server/wifi/WifiSupplicantControl.java +++ b/service/java/com/android/server/wifi/WifiSupplicantControl.java @@ -41,7 +41,6 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.BitSet; import java.util.HashMap; @@ -79,6 +78,9 @@ public class WifiSupplicantControl { private boolean mVerboseLoggingEnabled = false; + // Indicates whether the system is capable of 802.11r fast BSS transition. + private boolean mSystemSupportsFastBssTransition = false; + WifiSupplicantControl(TelephonyManager telephonyManager, WifiNative wifiNative, LocalLog localLog) { mTelephonyManager = telephonyManager; @@ -409,6 +411,21 @@ public class WifiSupplicantControl { return true; } + private BitSet addFastTransitionFlags(BitSet keyManagementFlags) { + if (!mSystemSupportsFastBssTransition) { + return keyManagementFlags; + } + + BitSet modifiedFlags = keyManagementFlags; + if (keyManagementFlags.get(WifiConfiguration.KeyMgmt.WPA_PSK)) { + modifiedFlags.set(WifiConfiguration.KeyMgmt.FT_PSK); + } + if (keyManagementFlags.get(WifiConfiguration.KeyMgmt.WPA_EAP)) { + modifiedFlags.set(WifiConfiguration.KeyMgmt.FT_EAP); + } + return modifiedFlags; + } + /** * Save an entire network configuration to wpa_supplicant. * @@ -438,8 +455,9 @@ public class WifiSupplicantControl { return false; } } + BitSet allowedKeyManagement = addFastTransitionFlags(config.allowedKeyManagement); String allowedKeyManagementString = - makeString(config.allowedKeyManagement, WifiConfiguration.KeyMgmt.strings); + makeString(allowedKeyManagement, WifiConfiguration.KeyMgmt.strings); if (config.allowedKeyManagement.cardinality() != 0 && !mWifiNative.setNetworkVariable( netId, WifiConfiguration.KeyMgmt.varName, @@ -892,6 +910,20 @@ public class WifiSupplicantControl { mVerboseLoggingEnabled = verbose; } + /** + * Get Fast BSS Transition capability. + */ + public boolean getSystemSupportsFastBssTransition() { + return mSystemSupportsFastBssTransition; + } + + /** + * Set Fast BSS Transition capability. + */ + public void setSystemSupportsFastBssTransition(boolean supported) { + mSystemSupportsFastBssTransition = supported; + } + private class SupplicantSaver implements WifiEnterpriseConfig.SupplicantSaver { private final int mNetId; private final String mSetterSSID; |