Filter out unsupported security type for DPP configuration.

There is different Wi-Fi security support between ZXing's Wi-Fi QR code
format and Wi-Fi DPP QR code format.

  ZXing's Wi-Fi QR code format: supports WEP / WPA / none security
  Wi-Fi DPP: supports WPA / SAE

So we will have different UI behavior for different security.

  WEP & none security: only support QR code generator
  WPA: supports both QR code generator & scanner
  SAE: only supports QR code scanner
  others: don't support. The share button is invisible

Bug: 123212410
Test: manual test
Change-Id: I87962d730282fc2c1b96223dca6feb79235fe5a1
This commit is contained in:
Arc Wang
2019-01-22 18:12:55 +08:00
parent 875178bbfa
commit cfa78006a0
6 changed files with 105 additions and 20 deletions

View File

@@ -17,6 +17,7 @@
package com.android.settings.wifi.dpp;
import static com.android.settings.wifi.dpp.WifiQrCode.SECURITY_NO_PASSWORD;
import static com.android.settings.wifi.dpp.WifiQrCode.SECURITY_SAE;
import static com.android.settings.wifi.dpp.WifiQrCode.SECURITY_WEP;
import static com.android.settings.wifi.dpp.WifiQrCode.SECURITY_WPA;
@@ -208,6 +209,19 @@ public class WifiNetworkConfig {
wifiManager.connect(wifiConfiguration, listener);
}
public boolean isSupportConfiguratorQrCodeScanner(Context context) {
if (!WifiDppUtils.isWifiDppEnabled(context)) {
return false;
}
// DPP 1.0 only supports SAE and PSK.
if (SECURITY_SAE.equals(mSecurity) || SECURITY_WPA.equals(mSecurity)) {
return true;
}
return false;
}
/**
* This is a simplified method from {@code WifiConfigController.getConfig()}
*/