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

Commit 59c0a7bc authored by Linus Tufvesson's avatar Linus Tufvesson
Browse files

Make WifiDppEnrolleeActivity launches explicit

Bug: 180518134
Test: make RunSettingsRoboTests \
ROBOTEST_FILTER=WifiDppUtilsTest\|WifiDialogActivityTest
Test: Manually verified b/180518134 attack is no longer possible

Change-Id: I8c4e1e17117582c78671d0e4658bd87715a9a046
parent 131a4abe
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1083,7 +1083,8 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
    @Override
    public void onScan(WifiDialog2 dialog, String ssid) {
        // Launch QR code scanner to join a network.
        startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
        startActivityForResult(
                WifiDppUtils.getEnrolleeQrCodeScannerIntent(dialog.getContext(), ssid),
                REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
    }

+2 −1
Original line number Diff line number Diff line
@@ -109,7 +109,8 @@ public class AddNetworkFragment extends InstrumentedFragment implements WifiConf
            final String ssid = ssidEditText.getText().toString();

            // Launch QR code scanner to join a network.
            startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
            startActivityForResult(
                    WifiDppUtils.getEnrolleeQrCodeScannerIntent(view.getContext(), ssid),
                    REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class AddWifiNetworkPreference extends Preference {
                getContext().getString(R.string.wifi_dpp_scan_qr_code));
        scanButton.setOnClickListener(view -> {
            getContext().startActivity(
                WifiDppUtils.getEnrolleeQrCodeScannerIntent(/* ssid */ null));
                    WifiDppUtils.getEnrolleeQrCodeScannerIntent(getContext(), /* ssid */ null));
        });
    }

+2 −2
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ public class WifiDialogActivity extends ObservableActivity implements WifiDialog

    @Override
    public void onScan(WifiDialog2 dialog, String ssid) {
        Intent intent = WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid);
        Intent intent = WifiDppUtils.getEnrolleeQrCodeScannerIntent(dialog.getContext(), ssid);
        WizardManagerHelper.copyWizardManagerExtras(mIntent, intent);

        // Launch QR code scanner to join a network.
@@ -329,7 +329,7 @@ public class WifiDialogActivity extends ObservableActivity implements WifiDialog

    @Override
    public void onScan(WifiDialog dialog, String ssid) {
        Intent intent = WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid);
        Intent intent = WifiDppUtils.getEnrolleeQrCodeScannerIntent(dialog.getContext(), ssid);
        WizardManagerHelper.copyWizardManagerExtras(mIntent, intent);

        // Launch QR code scanner to join a network.
+2 −1
Original line number Diff line number Diff line
@@ -1028,7 +1028,8 @@ public class WifiSettings extends RestrictedSettingsFragment
    @Override
    public void onScan(WifiDialog2 dialog, String ssid) {
        // Launch QR code scanner to join a network.
        startActivityForResult(WifiDppUtils.getEnrolleeQrCodeScannerIntent(ssid),
        startActivityForResult(
                WifiDppUtils.getEnrolleeQrCodeScannerIntent(dialog.getContext(), ssid),
                REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER);
    }

Loading