Merge "Use RestrictedPreference for all biometric settings." into sc-dev am: 7e9077fd14
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15394293 Change-Id: I39c616c70076dd98e24d138a0459d4914511a677
This commit is contained in:
@@ -48,6 +48,8 @@ import org.robolectric.shadows.ShadowApplication;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class CombinedBiometricStatusPreferenceControllerTest {
|
||||
|
||||
private static final String TEST_PREF_KEY = "foo";
|
||||
|
||||
@Mock
|
||||
private LockPatternUtils mLockPatternUtils;
|
||||
@Mock
|
||||
@@ -80,7 +82,7 @@ public class CombinedBiometricStatusPreferenceControllerTest {
|
||||
when(mFeatureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
|
||||
.thenReturn(mLockPatternUtils);
|
||||
when(mUm.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[] {1234});
|
||||
mController = new CombinedBiometricStatusPreferenceController(mContext);
|
||||
mController = new CombinedBiometricStatusPreferenceController(mContext, TEST_PREF_KEY);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -55,6 +55,9 @@ import java.util.Collections;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class FaceStatusPreferenceControllerTest {
|
||||
|
||||
private static final String TEST_PREF_KEY = "baz";
|
||||
|
||||
@Mock
|
||||
private LockPatternUtils mLockPatternUtils;
|
||||
@Mock
|
||||
@@ -82,7 +85,7 @@ public class FaceStatusPreferenceControllerTest {
|
||||
when(mFeatureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
|
||||
.thenReturn(mLockPatternUtils);
|
||||
when(mUm.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[] {1234});
|
||||
mController = new FaceStatusPreferenceController(mContext);
|
||||
mController = new FaceStatusPreferenceController(mContext, TEST_PREF_KEY);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@@ -44,6 +44,7 @@ import org.robolectric.shadows.ShadowApplication;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class FingerprintProfileStatusPreferenceControllerTest {
|
||||
|
||||
private static final String TEST_PREF_KEY = "bar";
|
||||
private static final int FAKE_PROFILE_USER_ID = 1234;
|
||||
|
||||
@Mock
|
||||
@@ -73,7 +74,7 @@ public class FingerprintProfileStatusPreferenceControllerTest {
|
||||
when(mFeatureFactory.securityFeatureProvider.getLockPatternUtils(mContext))
|
||||
.thenReturn(mLockPatternUtils);
|
||||
when(mUm.getProfileIdsWithDisabled(anyInt())).thenReturn(new int[] {1234});
|
||||
mController = new FingerprintProfileStatusPreferenceController(mContext);
|
||||
mController = new FingerprintProfileStatusPreferenceController(mContext, TEST_PREF_KEY);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -104,6 +105,8 @@ public class FingerprintProfileStatusPreferenceControllerTest {
|
||||
|
||||
@Test
|
||||
public void getPreferenceKey_byDefault_returnsDefaultValue() {
|
||||
mController = new FingerprintProfileStatusPreferenceController(mContext);
|
||||
|
||||
assertThat(mController.getPreferenceKey()).isEqualTo("fingerprint_settings_profile");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user