Change preference title if Active Unlock enabled
Change the title of the preference to reflect that Active Unlock can also be used to unlock the device. Test: make RunSettingsRoboTests Bug: b/271782800 Change-Id: Ie227e6dddfc024235fc3568899ef151f14f17696
This commit is contained in:
@@ -222,4 +222,44 @@ public class ActiveUnlockStatusUtilsTest {
|
||||
.isEqualTo(mApplicationContext.getString(
|
||||
R.string.biometric_settings_use_face_or_watch_preference_summary));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUseBiometricTitle_faceAndFingerprintEnabled_returnsFaceFingerprintOrWatch() {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||
when(mFaceManager.isHardwareDetected()).thenReturn(true);
|
||||
|
||||
assertThat(mActiveUnlockStatusUtils.getUseBiometricTitleForActiveUnlock())
|
||||
.isEqualTo(mApplicationContext.getString(
|
||||
R.string.biometric_settings_use_face_fingerprint_or_watch_for));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUseBiometricTitle_fingerprintEnabled_returnsFingerprintOrWatch() {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
|
||||
when(mFaceManager.isHardwareDetected()).thenReturn(false);
|
||||
|
||||
assertThat(mActiveUnlockStatusUtils.getUseBiometricTitleForActiveUnlock())
|
||||
.isEqualTo(mApplicationContext.getString(
|
||||
R.string.biometric_settings_use_fingerprint_or_watch_for));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUseBiometricTitle_faceEnabled_returnsFaceOrWatch() {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
|
||||
when(mFaceManager.isHardwareDetected()).thenReturn(true);
|
||||
|
||||
assertThat(mActiveUnlockStatusUtils.getUseBiometricTitleForActiveUnlock())
|
||||
.isEqualTo(mApplicationContext.getString(
|
||||
R.string.biometric_settings_use_face_or_watch_for));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUseBiometricTitle_withoutFaceOrFingerprint_returnsWatch() {
|
||||
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
|
||||
when(mFaceManager.isHardwareDetected()).thenReturn(false);
|
||||
|
||||
assertThat(mActiveUnlockStatusUtils.getUseBiometricTitleForActiveUnlock())
|
||||
.isEqualTo(mApplicationContext.getString(
|
||||
R.string.biometric_settings_use_watch_for));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user