Add Hotspot WPA3 Settings

- Add WPA3 SAE security types
  - "WPA3-Personal"
  - "WPA2/WPA3-Personal"

- Verify valid WPA3 password

- Enable QR code scanner for Hotspot WPA3

- Avoid null point exception when settings keyword searching

- Screenshot
  https://screenshot.googleplex.com/B6u54wh8w35Xnyf
  https://screenshot.googleplex.com/8hWHHUTb6UaS9vB

Bug: 167968488
Test: manual test
- atest WifiTetherSecurityPreferenceControllerTest
- atest WifiUtilsTest

Change-Id: I2992040498f8add107a4cce70a92c1c6ee6ab805
This commit is contained in:
Weng Su
2020-09-15 13:24:34 +00:00
parent 6ac579fe44
commit b9c865b704
10 changed files with 368 additions and 150 deletions

View File

@@ -192,7 +192,7 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
@Override
public void onTetherConfigUpdated(AbstractPreferenceController context) {
final SoftApConfiguration config = buildNewConfig();
mPasswordPreferenceController.updateVisibility(config.getSecurityType());
mPasswordPreferenceController.setSecurityType(config.getSecurityType());
/**
* if soft AP is stopped, bring up
@@ -216,10 +216,10 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
final SoftApConfiguration.Builder configBuilder = new SoftApConfiguration.Builder();
final int securityType = mSecurityPreferenceController.getSecurityType();
configBuilder.setSsid(mSSIDPreferenceController.getSSID());
if (securityType == SoftApConfiguration.SECURITY_TYPE_WPA2_PSK) {
if (securityType != SoftApConfiguration.SECURITY_TYPE_OPEN) {
configBuilder.setPassphrase(
mPasswordPreferenceController.getPasswordValidated(securityType),
SoftApConfiguration.SECURITY_TYPE_WPA2_PSK);
securityType);
}
configBuilder.setBand(mApBandPreferenceController.getBandIndex());
return configBuilder.build();