From 37b214b8c61342f99c342bc3e68b953ddf452f74 Mon Sep 17 00:00:00 2001 From: Chandru S Date: Fri, 23 Jun 2023 09:23:20 -0700 Subject: [PATCH] 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 --- .../repository/DeviceEntryFaceAuthRepository.kt | 4 ++-- .../DeviceEntryFaceAuthRepositoryTest.kt | 14 -------------- 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 128057ae6b621..b17661db353ac 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 5922cbf6268e0..8e6adb41d4a8f 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 @@ -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 {