Update settings together with frameworks/base
LockSettingsService returns a handle to the gatekeeper password instead of the password itself now. As such, update areas of code accordingly. Bug: 161765592 Test: RunSettingsRoboTests Run the following on face/fingerprint devices Test: Remove credential adb shell am start -a android.app.action.SET_NEW_PASSWORD Set up credential + fingerprint Test: Remove credential, adb shell am start -a android.settings.FINGERPRINT_SETTINGS This tests the ChooseLock* logic in FingerprintSettings Test: Set up credential, adb shell am start -a android.settings.FINGERPRINT_SETTINGS This tests the ConfirmLock* logic in FingerprintSettings Test: Remove device credential, enroll fingerprint/face. Succeeds. This tests the ChooseLock* returning SP path from BiometricEnrollIntro Test: With credential and fingerprint/face enrolled, go to fingerprint/face settings and enroll. This tests the ConfirmLock* path in Fingerprint/FaceSettings Test: Remove device credential, enroll credential-only, enroll fingerprint/face separately. Succeeds. This tests the ConfirmLock* returning SP path in BiometricEnrollIntro Test: In SUW, set up credential, then biometric. This tests the ChooseLock* path in SUW Test: In SUW, set up credential, go back, then set up biometric. This tests the ConfirmLock* path in SUW Change-Id: Ibc71ec88f8192620d041bfd125f400371708b296
This commit is contained in:
@@ -110,12 +110,13 @@ public class ChooseLockPasswordTest {
|
||||
@Test
|
||||
public void intentBuilder_setRequestGatekeeperPassword_shouldAddExtras() {
|
||||
Intent intent = new IntentBuilder(application)
|
||||
.setRequestGatekeeperPassword(true)
|
||||
.setRequestGatekeeperPasswordHandle(true)
|
||||
.setPasswordQuality(PASSWORD_QUALITY_ALPHANUMERIC)
|
||||
.setUserId(123)
|
||||
.build();
|
||||
|
||||
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW, false))
|
||||
assertThat(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE,
|
||||
false))
|
||||
.named("EXTRA_KEY_REQUEST_GK_PW")
|
||||
.isTrue();
|
||||
assertThat(intent.getIntExtra(PASSWORD_TYPE_KEY, 0))
|
||||
|
@@ -74,12 +74,12 @@ public class ChooseLockPatternTest {
|
||||
@Test
|
||||
public void intentBuilder_setRequestGatekeeperPassword_shouldAddExtras() {
|
||||
Intent intent = new IntentBuilder(application)
|
||||
.setRequestGatekeeperPassword(true)
|
||||
.setRequestGatekeeperPasswordHandle(true)
|
||||
.setUserId(123)
|
||||
.build();
|
||||
|
||||
assertThat(intent
|
||||
.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW, false))
|
||||
.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE, false))
|
||||
.named("EXTRA_KEY_REQUEST_GK_PW")
|
||||
.isTrue();
|
||||
assertThat(intent
|
||||
|
@@ -23,7 +23,7 @@ import static com.android.settings.password.ChooseLockGeneric.ChooseLockGenericF
|
||||
import static com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment.MINIMUM_QUALITY_KEY;
|
||||
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.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW;
|
||||
import static com.android.settings.password.ChooseLockSettingsHelper.EXTRA_KEY_REQUEST_GK_PW_HANDLE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
@@ -270,7 +270,7 @@ public final class SetNewPasswordControllerTest {
|
||||
actualBundle.getBoolean(HIDE_DISABLED_PREFS));
|
||||
assertTrue(
|
||||
"Fingerprint enroll must request Gatekeeper Password.",
|
||||
actualBundle.getBoolean(EXTRA_KEY_REQUEST_GK_PW));
|
||||
actualBundle.getBoolean(EXTRA_KEY_REQUEST_GK_PW_HANDLE));
|
||||
assertTrue(
|
||||
"The request must be a fingerprint set up request.",
|
||||
actualBundle.getBoolean(EXTRA_KEY_FOR_FINGERPRINT));
|
||||
@@ -290,7 +290,7 @@ public final class SetNewPasswordControllerTest {
|
||||
actualBundle.getBoolean(HIDE_DISABLED_PREFS));
|
||||
assertTrue(
|
||||
"Face enroll must request Gatekeeper Password",
|
||||
actualBundle.getBoolean(EXTRA_KEY_REQUEST_GK_PW));
|
||||
actualBundle.getBoolean(EXTRA_KEY_REQUEST_GK_PW_HANDLE));
|
||||
assertTrue(
|
||||
"The request must be a face set up request.",
|
||||
actualBundle.getBoolean(EXTRA_KEY_FOR_FACE));
|
||||
|
Reference in New Issue
Block a user