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

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

Merge "Fix incorrect choose screen lock during unicorn" into tm-qpr-dev

parents 97985b62 4f93ef77
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -564,7 +564,13 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
        Intent intent = BiometricUtils.getChooseLockIntent(this, getIntent());
        intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_INSECURE_OPTIONS, true);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE, true);
        if (mHasFeatureFingerprint && mHasFeatureFace) {
            intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, true);
        } else if (mHasFeatureFace) {
            intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE, true);
        } else if (mHasFeatureFingerprint) {
            intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT, true);
        }

        if (mUserId != UserHandle.USER_NULL) {
            intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
+13 −3
Original line number Diff line number Diff line
@@ -20,6 +20,11 @@ import static android.provider.Settings.ACTION_BIOMETRIC_ENROLL;

import static androidx.test.espresso.intent.Intents.intended;
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasExtra;

import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS;
import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_FOR_FACE;
import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_FOR_FINGERPRINT;

import static com.google.common.truth.Truth.assertThat;

@@ -83,6 +88,13 @@ public class BiometricEnrollActivityTest {
        try (ActivityScenario<BiometricEnrollActivity> scenario =
                     ActivityScenario.launch(getIntent())) {
            intended(hasComponent(ChooseLockGeneric.class.getName()));
            if (mHasFace && mHasFingerprint) {
                intended(hasExtra(EXTRA_KEY_FOR_BIOMETRICS, true));
            } else if (mHasFace) {
                intended(hasExtra(EXTRA_KEY_FOR_FACE, true));
            } else if (mHasFingerprint) {
                intended(hasExtra(EXTRA_KEY_FOR_FINGERPRINT, true));
            }
        }
    }

@@ -109,11 +121,9 @@ public class BiometricEnrollActivityTest {
                            response.getGatekeeperPasswordHandle());
                }).get();



        try (ActivityScenario<BiometricEnrollActivity> scenario =
                     ActivityScenario.launch(intent)) {
            intended(hasComponent(mHasFace
            intended(hasComponent(mHasFace && !mHasFingerprint
                    ? FaceEnrollIntroduction.class.getName()
                    : FingerprintEnrollIntroduction.class.getName()));
        }