Add mandatory biometric prompt to platform surfaces (3/N)
Pass user ids for identity check. This is to make sure that the right user is requested auth for different profiles. Flag: android.hardware.biometrics.Flags.MANDATORY_BIOMETRICS Bug: 339910718 Test: atest UtilsTest Change-Id: I953b56e9bfd1edd49d080124905d42a23247b7a7
This commit is contained in:
@@ -140,8 +140,8 @@ public class MainClearTest {
|
||||
when(mScrollView.getChildCount()).thenReturn(1);
|
||||
doReturn(mMockActivity).when(mMainClear).getActivity();
|
||||
when(mMockActivity.getSystemService(BiometricManager.class)).thenReturn(mBiometricManager);
|
||||
when(mBiometricManager.canAuthenticate(
|
||||
BiometricManager.Authenticators.MANDATORY_BIOMETRICS))
|
||||
when(mBiometricManager.canAuthenticate(anyInt(),
|
||||
eq(BiometricManager.Authenticators.MANDATORY_BIOMETRICS)))
|
||||
.thenReturn(BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE);
|
||||
}
|
||||
|
||||
@@ -370,8 +370,8 @@ public class MainClearTest {
|
||||
when(mContext.getResources()).thenReturn(mResources);
|
||||
when(mMockActivity.getSystemService(BiometricManager.class)).thenReturn(mBiometricManager);
|
||||
when(mResources.getString(anyInt())).thenReturn(TEST_ACCOUNT_NAME);
|
||||
when(mBiometricManager.canAuthenticate(
|
||||
BiometricManager.Authenticators.MANDATORY_BIOMETRICS))
|
||||
when(mBiometricManager.canAuthenticate(anyInt(),
|
||||
eq(BiometricManager.Authenticators.MANDATORY_BIOMETRICS)))
|
||||
.thenReturn(BiometricManager.BIOMETRIC_SUCCESS);
|
||||
doReturn(true).when(mMainClear).isValidRequestCode(eq(MainClear.KEYGUARD_REQUEST));
|
||||
doNothing().when(mMainClear).startActivityForResult(any(), anyInt());
|
||||
|
Reference in New Issue
Block a user