Fix tests for BiometricsSafetySource and LockScreenSafetySource.

It seems these tests have been failing for a while (probably they were never passing in the first place; as the issue appears to be with the tests and not the prod code).

Are they not being run on pre and/or post-submit?

Bug: 323649900
Test: atest LockScreenSafetySourceTest && atest BiometricsSafetySourceTest
Change-Id: Ie75241455317da6749ccf648dae71c49ea9f766f
This commit is contained in:
Elliot Sisteron
2024-02-05 11:50:36 +00:00
parent 6b64e92fc8
commit f26e541e86
2 changed files with 3 additions and 1 deletions

View File

@@ -114,7 +114,7 @@ public class BiometricsSafetySourceTest {
@Test
public void setSafetySourceData_whenSafetyCenterIsEnabled_withoutBiometrics_setsNullData() {
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(false);
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
when(mFaceManager.isHardwareDetected()).thenReturn(false);

View File

@@ -413,6 +413,8 @@ public class LockScreenSafetySourceTest {
when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
when(mScreenLockPreferenceDetailsUtils.isPasswordQualityManaged(anyInt(), any()))
.thenReturn(false);
when(mScreenLockPreferenceDetailsUtils.isLockPatternSecure()).thenReturn(true);
when(mScreenLockPreferenceDetailsUtils.shouldShowGearMenu()).thenReturn(true);
LockScreenSafetySource.setSafetySourceData(
mApplicationContext, mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);