Loading packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -1070,6 +1070,25 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() { faceAuthenticateIsCalled() } @Test fun retryFaceAuthAfterCancel() = testScope.runTest { initCollectors() allPreconditionsToRunFaceAuthAreTrue() val isAuthRunning by collectLastValue(underTest.isAuthRunning) underTest.requestAuthenticate(FaceAuthUiEvent.FACE_AUTH_CAMERA_AVAILABLE_CHANGED) underTest.cancel() clearInvocations(faceManager) underTest.requestAuthenticate(FaceAuthUiEvent.FACE_AUTH_CAMERA_AVAILABLE_CHANGED) advanceTimeBy(DeviceEntryFaceAuthRepositoryImpl.DEFAULT_CANCEL_SIGNAL_TIMEOUT) runCurrent() assertThat(isAuthRunning).isEqualTo(true) faceAuthenticateIsCalled() } private suspend fun TestScope.testGatingCheckForFaceAuth( gatingCheckModifier: suspend () -> Unit ) { Loading packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt +4 −1 Original line number Diff line number Diff line Loading @@ -517,9 +517,12 @@ constructor( private fun onFaceAuthRequestCompleted() { cancelNotReceivedHandlerJob?.cancel() cancellationInProgress.value = false _isAuthRunning.value = false authCancellationSignal = null // Updates to "cancellationInProgress" may re-trigger face auth // (see processPendingAuthRequests()), so we must update this after setting _isAuthRunning // to false. cancellationInProgress.value = false } private val detectionCallback = Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepositoryTest.kt +19 −0 Original line number Diff line number Diff line Loading @@ -1070,6 +1070,25 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() { faceAuthenticateIsCalled() } @Test fun retryFaceAuthAfterCancel() = testScope.runTest { initCollectors() allPreconditionsToRunFaceAuthAreTrue() val isAuthRunning by collectLastValue(underTest.isAuthRunning) underTest.requestAuthenticate(FaceAuthUiEvent.FACE_AUTH_CAMERA_AVAILABLE_CHANGED) underTest.cancel() clearInvocations(faceManager) underTest.requestAuthenticate(FaceAuthUiEvent.FACE_AUTH_CAMERA_AVAILABLE_CHANGED) advanceTimeBy(DeviceEntryFaceAuthRepositoryImpl.DEFAULT_CANCEL_SIGNAL_TIMEOUT) runCurrent() assertThat(isAuthRunning).isEqualTo(true) faceAuthenticateIsCalled() } private suspend fun TestScope.testGatingCheckForFaceAuth( gatingCheckModifier: suspend () -> Unit ) { Loading
packages/SystemUI/src/com/android/systemui/deviceentry/data/repository/DeviceEntryFaceAuthRepository.kt +4 −1 Original line number Diff line number Diff line Loading @@ -517,9 +517,12 @@ constructor( private fun onFaceAuthRequestCompleted() { cancelNotReceivedHandlerJob?.cancel() cancellationInProgress.value = false _isAuthRunning.value = false authCancellationSignal = null // Updates to "cancellationInProgress" may re-trigger face auth // (see processPendingAuthRequests()), so we must update this after setting _isAuthRunning // to false. cancellationInProgress.value = false } private val detectionCallback = Loading