[Wi-Fi DPP] Improve Wi-Fi QR code error messages

Give all failures of Wi-Fi QR code format or data problem
with a correct error message.

Bug: 134033509
Test: manual visual
Change-Id: I5259d0d68e47d00a69e3e8107697605f3f187203
This commit is contained in:
Arc Wang
2019-06-13 16:24:14 +08:00
parent 838cbbf539
commit d2dc5438fa
3 changed files with 6 additions and 6 deletions

View File

@@ -433,14 +433,14 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
try {
mWifiQrCode = new WifiQrCode(qrCode);
} catch (IllegalArgumentException e) {
showErrorMessage(R.string.wifi_dpp_could_not_detect_valid_qr_code);
showErrorMessage(R.string.wifi_dpp_qr_code_is_not_valid_format);
return false;
}
// It's impossible to provision other device with ZXing Wi-Fi Network config format
final String scheme = mWifiQrCode.getScheme();
if (mIsConfiguratorMode && WifiQrCode.SCHEME_ZXING_WIFI_NETWORK_CONFIG.equals(scheme)) {
showErrorMessage(R.string.wifi_dpp_could_not_detect_valid_qr_code);
showErrorMessage(R.string.wifi_dpp_qr_code_is_not_valid_format);
return false;
}
@@ -564,7 +564,7 @@ public class WifiDppQrCodeScannerFragment extends WifiDppQrCodeBaseFragment impl
int errorMessageResId = 0;
switch (code) {
case EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_INVALID_URI:
errorMessageResId = R.string.wifi_dpp_could_not_detect_valid_qr_code;
errorMessageResId = R.string.wifi_dpp_qr_code_is_not_valid_format;
break;
case EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION: