Avoid using MANDATORY_BIOMETRICS bit if flag is not enabled
Flag: android.hardware.biometrics.flags.mandatory_biometrics Bug: 370757426 Test: N/A Change-Id: I4e2a72a80f68579d60466e859370b6fd93a8cd23
This commit is contained in:
@@ -564,6 +564,8 @@ public class UtilsTest {
|
||||
@Test
|
||||
@EnableFlags(Flags.FLAG_MANDATORY_BIOMETRICS)
|
||||
public void testRequestBiometricAuthentication_biometricManagerReturnsSuccessForDifferentUser_shouldReturnError() {
|
||||
when(mContext.getSystemService(UserManager.class)).thenReturn(mMockUserManager);
|
||||
when(mMockUserManager.getCredentialOwnerProfile(USER_ID)).thenReturn(USER_ID);
|
||||
when(mBiometricManager.canAuthenticate(anyInt(),
|
||||
eq(BiometricManager.Authenticators.MANDATORY_BIOMETRICS)))
|
||||
.thenReturn(BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE);
|
||||
@@ -579,6 +581,8 @@ public class UtilsTest {
|
||||
@EnableFlags(Flags.FLAG_MANDATORY_BIOMETRICS)
|
||||
public void testLaunchBiometricPrompt_checkIntentValues() {
|
||||
when(mFragment.getContext()).thenReturn(mContext);
|
||||
when(mContext.getSystemService(UserManager.class)).thenReturn(mMockUserManager);
|
||||
when(mMockUserManager.getCredentialOwnerProfile(USER_ID)).thenReturn(USER_ID);
|
||||
|
||||
final int requestCode = 1;
|
||||
final ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
|
||||
|
Reference in New Issue
Block a user