Merge "Change preference title if Active Unlock enabled" into udc-dev am: 42deb763e0 am: 60419e72bd

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22997141

Change-Id: I8201e20c39ef02beebb117731b7ed9dcc105bae9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Derek Jedral
2023-05-08 20:27:38 +00:00
committed by Automerger Merge Worker
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));
}
}