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:
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user