Fix incorrect choose screen lock during unicorn
ChooseLockGeneneric uses intent extra key to determine correct strings on "Choose screen lock" screen. Bug: 219419005 Test: atest BiometricEnrollActivityTest Test: Manully test SUW as following combinations 1. W/ unicorn flow or W/O unicorn flow 2. Fingerprint only devices or Fingerpirnt+Face devices Change-Id: I2abf9555676f3fb3b92dd6ddcc091ea8158bfe9f
This commit is contained in:
@@ -564,7 +564,13 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
Intent intent = BiometricUtils.getChooseLockIntent(this, getIntent());
|
Intent intent = BiometricUtils.getChooseLockIntent(this, getIntent());
|
||||||
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_INSECURE_OPTIONS, true);
|
intent.putExtra(ChooseLockGeneric.ChooseLockGenericFragment.HIDE_INSECURE_OPTIONS, true);
|
||||||
intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE, 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) {
|
if (mUserId != UserHandle.USER_NULL) {
|
||||||
intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
|
intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
|
||||||
|
@@ -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.Intents.intended;
|
||||||
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;
|
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;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
@@ -83,6 +88,13 @@ public class BiometricEnrollActivityTest {
|
|||||||
try (ActivityScenario<BiometricEnrollActivity> scenario =
|
try (ActivityScenario<BiometricEnrollActivity> scenario =
|
||||||
ActivityScenario.launch(getIntent())) {
|
ActivityScenario.launch(getIntent())) {
|
||||||
intended(hasComponent(ChooseLockGeneric.class.getName()));
|
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());
|
response.getGatekeeperPasswordHandle());
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try (ActivityScenario<BiometricEnrollActivity> scenario =
|
try (ActivityScenario<BiometricEnrollActivity> scenario =
|
||||||
ActivityScenario.launch(intent)) {
|
ActivityScenario.launch(intent)) {
|
||||||
intended(hasComponent(mHasFace
|
intended(hasComponent(mHasFace && !mHasFingerprint
|
||||||
? FaceEnrollIntroduction.class.getName()
|
? FaceEnrollIntroduction.class.getName()
|
||||||
: FingerprintEnrollIntroduction.class.getName()));
|
: FingerprintEnrollIntroduction.class.getName()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user