Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2dc5438 authored by Arc Wang's avatar Arc Wang
Browse files

[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
parent 838cbbf5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2185,8 +2185,6 @@
    <string name="wifi_dpp_scan_qr_code_with_another_device">Scan this QR code to connect to \u201c<xliff:g id="ssid" example="OfficeWifi">%1$s</xliff:g>\u201d and share the password</string>
    <!-- Hint for the user to use another device to scan QR code on screen to join a open Wi-Fi [CHAR LIMIT=NONE] -->
    <string name="wifi_dpp_scan_open_network_qr_code_with_another_device">Scan this QR code to connect to \u201c<xliff:g id="ssid" example="OfficeWifi">%1$s</xliff:g>\u201d</string>
    <!-- Hint for QR code detection [CHAR LIMIT=NONE]  -->
    <string name="wifi_dpp_could_not_detect_valid_qr_code">Couldn\u2019t read QR code. Re-center code and try again</string>
    <!-- Hint for Wi-Fi DPP handshake failure [CHAR LIMIT=NONE]  -->
    <string name="wifi_dpp_failure_authentication_or_configuration">Try again. If the issue continues, contact the device manufacturer</string>
    <!-- Hint for Wi-Fi DPP handshake failure [CHAR LIMIT=NONE]  -->
@@ -2231,6 +2229,8 @@
    <string name="wifi_dpp_add_device">Add device</string>
    <!-- Hint for "Add device" [CHAR LIMIT=NONE]  -->
    <string name="wifi_dpp_connect_network_using_qr_code">Use a QR code to add a device to this network</string>
    <!-- Hint for QR code process failure [CHAR LIMIT=NONE]  -->
    <string name="wifi_dpp_qr_code_is_not_valid_format">QR code isn\u0027t a valid format</string>
     <!-- Label for the try again button [CHAR LIMIT=20]-->
    <string name="retry">Retry</string>
    <!-- Label for the check box to share a network with other users on the same device -->
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ public class WifiDppAddDeviceFragment extends WifiDppQrCodeBaseFragment {
    private void showErrorUi(int code, boolean isConfigurationChange) {
        switch (code) {
            case EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_INVALID_URI:
                mSummary.setText(R.string.wifi_dpp_could_not_detect_valid_qr_code);
                mSummary.setText(R.string.wifi_dpp_qr_code_is_not_valid_format);
                break;

            case EasyConnectStatusCallback.EASY_CONNECT_EVENT_FAILURE_AUTHENTICATION:
+3 −3
Original line number Diff line number Diff line
@@ -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: