Merge changes I2536ae30,Ieaef83a2 into udc-qpr-dev

* changes:
  Do not run face auth if keyguard is already authenticated with face.
  Do not make device is asleep a gating condition for face auth
This commit is contained in:
Chandru S
2023-06-27 07:58:04 +00:00
committed by Android (Google) Code Review
2 changed files with 4 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(
@@ -365,6 +365,7 @@ constructor(
"nonStrongBiometricIsAllowed",
faceAuthLog
),
logAndObserve(isAuthenticated.isFalse(), "faceNotAuthenticated", faceAuthLog),
)
.reduce(::and)
.distinctUntilChanged()

View File

@@ -260,6 +260,7 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
assertThat(authStatus()).isEqualTo(SuccessAuthenticationStatus(successResult))
assertThat(authenticated()).isTrue()
assertThat(authRunning()).isFalse()
assertThat(canFaceAuthRun()).isFalse()
}
private fun uiEventIsLogged(faceAuthUiEvent: FaceAuthUiEvent) {
@@ -550,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 {