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

Commit 3e51ebc5 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 24D1-dev

parents ea2fd638 b51b0141
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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
    ) {
+4 −1
Original line number Diff line number Diff line
@@ -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 =