diff options
Diffstat (limited to 'service/java/com/android/server/wifi/WifiConfigStore.java')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigStore.java | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index b693e2344..beb3373d2 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -421,13 +421,6 @@ public class WifiConfigStore { } config.setIpAssignment(IpAssignment.DHCP); config.setProxySettings(ProxySettings.NONE); - if (!WifiServiceImpl.isValid(config)) { - if (mShowNetworks) { - localLog("Ignoring network " + config.networkId + " because configuration " - + "loaded from wpa_supplicant.conf is not valid."); - } - continue; - } // The configKey is explicitly stored in wpa_supplicant.conf, because config does // not contain sufficient information to compute it at this point. String configKey = extras.get(ID_STRING_KEY_CONFIG_KEY); @@ -601,14 +594,27 @@ public class WifiConfigStore { return true; } + private BitSet addFastTransitionFlags(BitSet 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. * * @param config Config corresponding to the network. - * @param netId Net Id of the network. + * @param netId Net Id of the network. + * @param addFastTransitionFlags Add the BSS fast transition(80211r) flags to the network. * @return true if successful, false otherwise. */ - private boolean saveNetwork(WifiConfiguration config, int netId) { + private boolean saveNetwork(WifiConfiguration config, int netId, + boolean addFastTransitionFlags) { if (config == null) { return false; } @@ -631,6 +637,10 @@ public class WifiConfigStore { return false; } } + BitSet allowedKeyManagement = config.allowedKeyManagement; + if (addFastTransitionFlags) { + allowedKeyManagement = addFastTransitionFlags(config.allowedKeyManagement); + } String allowedKeyManagementString = makeString(config.allowedKeyManagement, WifiConfiguration.KeyMgmt.strings); if (config.allowedKeyManagement.cardinality() != 0 && !mWifiNative.setNetworkVariable( @@ -788,11 +798,13 @@ public class WifiConfigStore { /** * Add or update a network configuration to wpa_supplicant. * - * @param config Config corresponding to the network. + * @param config Config corresponding to the network. * @param existingConfig Existing config corresponding to the network saved in our database. + * @param addFastTransitionFlags Add the BSS fast transition(80211r) flags to the network. * @return true if successful, false otherwise. */ - public boolean addOrUpdateNetwork(WifiConfiguration config, WifiConfiguration existingConfig) { + public boolean addOrUpdateNetwork(WifiConfiguration config, WifiConfiguration existingConfig, + boolean addFastTransitionFlags) { if (config == null) { return false; } @@ -816,7 +828,7 @@ public class WifiConfigStore { // Save the new network ID to the config config.networkId = netId; } - if (!saveNetwork(config, netId)) { + if (!saveNetwork(config, netId, addFastTransitionFlags)) { if (newNetwork) { mWifiNative.removeNetwork(netId); loge("Failed to set a network variable, removed network: " + netId); |