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

Commit 5f876de1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Show security screen for ACTION_PROCESS_WIFI_EASY_CONNECT_URI intent" into sc-dev

parents e39066c3 d451d167
Loading
Loading
Loading
Loading
+30 −25
Original line number Diff line number Diff line
@@ -144,6 +144,20 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
                }
                break;
            case Settings.ACTION_PROCESS_WIFI_EASY_CONNECT_URI:
                WifiDppUtils.showLockScreen(this,
                        () -> handleActionProcessWifiEasyConnectUriIntent(intent));
                break;
            default:
                cancelActivity = true;
                Log.e(TAG, "Launch with an invalid action");
        }

        if (cancelActivity) {
            finish();
        }
    }

    private void handleActionProcessWifiEasyConnectUriIntent(Intent intent) {
        final Uri uri = intent.getData();
        final String uriString = (uri == null) ? null : uri.toString();
        mWifiDppQrCode = WifiQrCode.getValidWifiDppQrCodeOrNull(uriString);
@@ -159,7 +173,7 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
            Log.e(TAG, "ACTION_PROCESS_WIFI_EASY_CONNECT_URI with null URI!");
        }
        if (mWifiDppQrCode == null || !isDppSupported) {
                    cancelActivity = true;
            finish();
        } else {
            final WifiNetworkConfig connectedConfig = getConnectedWifiNetworkConfigOrNull();
            if (connectedConfig == null || !connectedConfig.isSupportWifiDpp(this)) {
@@ -169,15 +183,6 @@ public class WifiDppConfiguratorActivity extends WifiDppBaseActivity implements
                showAddDeviceFragment(/* addToBackStack */ false);
            }
        }
                break;
            default:
                cancelActivity = true;
                Log.e(TAG, "Launch with an invalid action");
        }

        if (cancelActivity) {
            finish();
        }
    }

    private void showQrCodeScannerFragment() {