Make it possible to have open tether network
Previously people could have open tether networks but a restrction was placed on this sometime in the past. However there is no migration plan in place for people with open tether networks which will cause problems when the new requirements are enforced. This CL makes it so tether networks can be open once more. Test: robotests Bug: 65784990 Change-Id: I6e350dd53b9b9f987dd5a4cc317ba18d7f50df79
This commit is contained in:
@@ -161,8 +161,8 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
|
||||
config.SSID = mSSIDPreferenceController.getSSID();
|
||||
config.preSharedKey = mPasswordPreferenceController.getPassword();
|
||||
ensureWifiConfigHasPassword(config);
|
||||
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA2_PSK);
|
||||
config.allowedKeyManagement.set(
|
||||
mPasswordPreferenceController.getSecuritySettingForPassword());
|
||||
config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
|
||||
config.apBand = mApBandPreferenceController.getBandIndex();
|
||||
return config;
|
||||
@@ -182,15 +182,6 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
|
||||
.updateDisplay();
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
static void ensureWifiConfigHasPassword(WifiConfiguration config) {
|
||||
if (TextUtils.isEmpty(config.preSharedKey)) {
|
||||
String randomUUID = UUID.randomUUID().toString();
|
||||
//first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
|
||||
config.preSharedKey = randomUUID.substring(0, 8) + randomUUID.substring(9, 13);
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
class TetherChangeReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user