(2/N) Biometric error dialog

Add an error dialog to help user recover from biometric error for
for identity check while trying to factory reset

Flag: android.hardware.biometrics.flag.mandatory_biometrics
Bug: 358641110
Bug: 358179610
Test: atest MainClearTest
Change-Id: Ia20389a3146aa45ad42bdc4d31f1bd9488f2dc42
This commit is contained in:
Diya Bera
2024-09-14 00:26:14 +00:00
parent 5335e26b29
commit 1c604f29ef
9 changed files with 118 additions and 56 deletions

View File

@@ -246,26 +246,6 @@ public class BuildNumberPreferenceControllerTest {
eq(BuildNumberPreferenceController.REQUEST_IDENTITY_CHECK_FOR_DEV_PREF));
}
@Test
@UiThreadTest
@RequiresFlagsEnabled(Flags.FLAG_MANDATORY_BIOMETRICS)
public void onActivityResult_confirmPasswordRequestCompleted_lockoutError() {
when(mUserManager.isAdminUser()).thenReturn(true);
when(mBiometricManager.canAuthenticate(mContext.getUserId(),
BiometricManager.Authenticators.MANDATORY_BIOMETRICS))
.thenReturn(BiometricManager.BIOMETRIC_ERROR_LOCKOUT);
final boolean activityResultHandled = mController.onActivityResult(
BuildNumberPreferenceController.REQUEST_CONFIRM_PASSWORD_FOR_DEV_PREF,
Activity.RESULT_OK,
null);
assertThat(activityResultHandled).isTrue();
verify(mFragment, never()).startActivityForResult(any(),
eq(BuildNumberPreferenceController.REQUEST_IDENTITY_CHECK_FOR_DEV_PREF));
assertThat(DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)).isFalse();
}
@Test
public void onActivityResult_confirmBiometricAuthentication_enableDevPref() {
when(mUserManager.isAdminUser()).thenReturn(true);