summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chandru S <chandruis@google.com> 2023-06-23 09:23:20 -0700
committer Chandru S <chandruis@google.com> 2023-06-26 15:53:50 +0000
commit37b214b8c61342f99c342bc3e68b953ddf452f74 (patch)
tree4cef8c75cb7ca3f42f21673e6ed323ff6f8385e5
parentb6629a268677f2a018c763927e72a2f103f8032c (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt14
2 files changed, 2 insertions, 16 deletions
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 128057ae6b62..b17661db353a 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 @@ constructor(
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 5922cbf6268e..8e6adb41d4a8 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 @@ 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 {
testGatingCheckForFaceAuth {