Merge "Fix incorrect choose screen lock during unicorn" into tm-qpr-dev am: 094d7badba am: 9386416103

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/19880532

Change-Id: I88e7db1f442c18aada11305ed54f0b5e66636d7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-09-13 07:17:39 +00:00
committed by Automerger Merge Worker
2 changed files with 20 additions and 4 deletions

View File

@@ -561,7 +561,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);
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_FOR_BIOMETRICS, 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);

View File

@@ -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()));
}