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
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
index 128057a..b17661d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
@@ -312,8 +312,8 @@
tableLogBuffer
),
logAndObserve(
- keyguardRepository.wakefulness.map { it.isStartingToSleepOrAsleep() }.isFalse(),
- "deviceNotSleepingOrNotStartingToSleep",
+ keyguardRepository.wakefulness.map { it.isStartingToSleep() }.isFalse(),
+ "deviceNotStartingToSleep",
tableLogBuffer
),
logAndObserve(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
index 5922cbf..8e6adb4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
@@ -551,20 +551,6 @@
}
@Test
- fun authenticateDoesNotRunWhenDeviceIsSleeping() =
- testScope.runTest {
- testGatingCheckForFaceAuth {
- keyguardRepository.setWakefulnessModel(
- WakefulnessModel(
- state = WakefulnessState.ASLEEP,
- lastWakeReason = WakeSleepReason.OTHER,
- lastSleepReason = WakeSleepReason.OTHER,
- )
- )
- }
- }
-
- @Test
fun authenticateDoesNotRunWhenNonStrongBiometricIsNotAllowed() =
testScope.runTest {
testGatingCheckForFaceAuth {