Inject different User IDs into biometric utils
Test: atest SettingsUnitTests Bug: 222217132 Change-Id: I7939d78817f53814d0f8fb4636231a4833fbe26a
This commit is contained in:
@@ -64,7 +64,7 @@ public class BiometricNavigationUtilsTest {
|
||||
mContext = spy(ApplicationProvider.getApplicationContext());
|
||||
when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager);
|
||||
doNothing().when(mContext).startActivity(any());
|
||||
mBiometricNavigationUtils = new BiometricNavigationUtils();
|
||||
mBiometricNavigationUtils = new BiometricNavigationUtils(UserHandle.myUserId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -56,7 +56,8 @@ public class CombinedBiometricStatusUtilsTest {
|
||||
|
||||
private static final ComponentName COMPONENT_NAME =
|
||||
new ComponentName("package", "class");
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(UserHandle.myUserId());
|
||||
private static final int USER_ID = UserHandle.myUserId();
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(USER_ID);;
|
||||
|
||||
|
||||
@Mock
|
||||
@@ -85,7 +86,8 @@ public class CombinedBiometricStatusUtilsTest {
|
||||
when(mApplicationContext.getSystemService(Context.DEVICE_POLICY_SERVICE))
|
||||
.thenReturn(mDevicePolicyManager);
|
||||
when(mApplicationContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager);
|
||||
mCombinedBiometricStatusUtils = new CombinedBiometricStatusUtils(mApplicationContext);
|
||||
mCombinedBiometricStatusUtils = new CombinedBiometricStatusUtils(
|
||||
mApplicationContext, USER_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -49,7 +49,8 @@ public class FaceStatusUtilsTest {
|
||||
|
||||
private static final ComponentName COMPONENT_NAME =
|
||||
new ComponentName("package", "class");
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(UserHandle.myUserId());
|
||||
private static final int USER_ID = UserHandle.myUserId();
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(USER_ID);
|
||||
|
||||
|
||||
@Mock
|
||||
@@ -78,7 +79,7 @@ public class FaceStatusUtilsTest {
|
||||
when(mApplicationContext.getSystemService(Context.DEVICE_POLICY_SERVICE))
|
||||
.thenReturn(mDevicePolicyManager);
|
||||
when(mApplicationContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager);
|
||||
mFaceStatusUtils = new FaceStatusUtils(mApplicationContext, mFaceManager);
|
||||
mFaceStatusUtils = new FaceStatusUtils(mApplicationContext, mFaceManager, USER_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -52,7 +52,8 @@ public class FingerprintStatusUtilsTest {
|
||||
|
||||
private static final ComponentName COMPONENT_NAME =
|
||||
new ComponentName("package", "class");
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(UserHandle.myUserId());
|
||||
private static final int USER_ID = UserHandle.myUserId();
|
||||
private static final UserHandle USER_HANDLE = new UserHandle(USER_ID);
|
||||
|
||||
|
||||
@Mock
|
||||
@@ -82,7 +83,7 @@ public class FingerprintStatusUtilsTest {
|
||||
.thenReturn(mDevicePolicyManager);
|
||||
when(mApplicationContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager);
|
||||
mFingerprintStatusUtils =
|
||||
new FingerprintStatusUtils(mApplicationContext, mFingerprintManager);
|
||||
new FingerprintStatusUtils(mApplicationContext, mFingerprintManager, USER_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user