Do not make device is asleep a gating condition for face auth

This prevents face auth from running when the user touches the UDFPS sensor on AOD
The device would still be asleep but we still want to run face auth.

This also fixes race conditions between device asleep still being true when we trigger face auth by lifting the device or tapping the device to wake up.

Fixes: 285499709
Fixes: 285501230

Test: atest DeviceEntryFaceAuthRepositoryTest
Change-Id: Ieaef83a2695de1c2d369068b4db08df5acb2357d
This commit is contained in:
Chandru S
2023-06-23 09:23:20 -07:00
parent b6629a2686
commit 37b214b8c6
2 changed files with 2 additions and 16 deletions

View File

@@ -312,8 +312,8 @@ constructor(
tableLogBuffer
),
logAndObserve(
keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() }.isFalse(),
"deviceNotSleepingOrNotStartingToSleep",
keyguardRepository.wakefulness.map { it.isStartingToSleep() }.isFalse(),
"deviceNotStartingToSleep",
tableLogBuffer
),
logAndObserve(

View File

@@ -550,20 +550,6 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
}
}
@Test
fun authenticateDoesNotRunWhenDeviceIsSleeping() =
testScope.runTest {
testGatingCheckForFaceAuth {
keyguardRepository.setWakefulnessModel(
WakefulnessModel(
state = WakefulnessState.ASLEEP,
lastWakeReason = WakeSleepReason.OTHER,
lastSleepReason = WakeSleepReason.OTHER,
)
)
}
}
@Test
fun authenticateDoesNotRunWhenNonStrongBiometricIsNotAllowed() =
testScope.runTest {