Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a79eba0 authored by Shawn Lin's avatar Shawn Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix the ring animation not showing while unfolding device" into main

parents f9aee061 2f2a52eb
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1063,6 +1063,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
    ) {
+4 −1
Original line number Diff line number Diff line
@@ -518,9 +518,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 =