summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Beverly <beverlyt@google.com> 2024-04-24 20:06:20 +0000
committer Beverly Tai <beverlyt@google.com> 2024-04-25 12:33:25 +0000
commit5e4aba32c4792c7cb06370e6efcd35506f7ffcf9 (patch)
tree089bb1e2281171a381a687a2f9b25d2692f19367
parent53a31c056890b0d0a70ab61f6c420f0041d7035c (diff)
Don't run face auth (non-bypass) on a dismissible keyguard
However, run face detect if bypass is enabled on a dismissible keyguard. Test: atest DeviceEntryFaceAuthRepositoryTest Test: fold the device to get to the unlocked keyugard; observe that non-bypass face auth doesn't run Fixes: 322106530 Flag: None Change-Id: Ia67946dd9d81fbc0fb3aece2ea7cec92196d45a3
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt7
2 files changed, 7 insertions, 4 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
index 68a85b4c7c2f..44e312d20142 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
@@ -656,7 +656,7 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
}
@Test
- fun authenticateFallbacksToDetectionWhenUserIsAlreadyTrustedByTrustManager() =
+ fun authenticateFallbacksToDetectionWhenKeyguardIsAlreadyDismissible() =
testScope.runTest {
whenever(faceManager.sensorPropertiesInternal)
.thenReturn(listOf(createFaceSensorProperties(supportsFaceDetection = true)))
@@ -665,7 +665,7 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
initCollectors()
allPreconditionsToRunFaceAuthAreTrue()
- trustRepository.setCurrentUserTrusted(true)
+ keyguardRepository.setKeyguardDismissible(true)
assertThat(canFaceAuthRun()).isFalse()
underTest.requestAuthenticate(
FACE_AUTH_TRIGGERED_SWIPE_UP_ON_BOUNCER,
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt
index 1eba0662a43d..8a25e4106751 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt
@@ -250,7 +250,10 @@ constructor(
listOf(
*gatingConditionsForAuthAndDetect(),
Pair(isLockedOut.isFalse(), "isNotInLockOutState"),
- Pair(trustRepository.isCurrentUserTrusted.isFalse(), "currentUserIsNotTrusted"),
+ Pair(
+ keyguardRepository.isKeyguardDismissible.isFalse(),
+ "keyguardIsNotDismissible"
+ ),
Pair(
biometricSettingsRepository.isFaceAuthCurrentlyAllowed,
"isFaceAuthCurrentlyAllowed"
@@ -273,7 +276,7 @@ constructor(
Pair(
biometricSettingsRepository.isFaceAuthCurrentlyAllowed
.isFalse()
- .or(trustRepository.isCurrentUserTrusted),
+ .or(keyguardRepository.isKeyguardDismissible),
"faceAuthIsNotCurrentlyAllowedOrCurrentUserIsTrusted"
),
// We don't want to run face detect if fingerprint can be used to unlock the