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:
Derek Jedral
2023-04-26 16:27:15 -07:00
parent 1f4ec6257f
commit 5a75cd54d4
4 changed files with 74 additions and 0 deletions

View File

@@ -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));
}
}