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

Commit 0ec6b1d6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Start running face auth at start of transition to bouncer" into main

parents 9e23b9a9 66be2b9e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest
import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.scene.data.repository.ShowOverlay
import com.android.systemui.scene.data.repository.setSceneTransition
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
@@ -425,6 +427,23 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() {
                .isEqualTo(Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN, false))
        }

    @Test
    @EnableSceneContainer
    fun withSceneContainerEnabled_faceAuthIsRequestedWhenTransitioningToPrimaryBouncer() =
        testScope.runTest {
            underTest.start()

            kosmos.setSceneTransition(
                ShowOverlay(
                    overlay = Overlays.Bouncer,
                    fromScene = Scenes.Lockscreen,
                    progress = flowOf(.5f),
                )
            )
            assertThat(faceAuthRepository.runningAuthRequest.value)
                .isEqualTo(Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_PRIMARY_BOUNCER_SHOWN, false))
        }

    @Test
    fun faceAuthIsRequestedWhenAlternateBouncerIsVisible() =
        testScope.runTest {
+3 −1
Original line number Diff line number Diff line
@@ -259,7 +259,9 @@ constructor(

    private val isBouncerVisible: Flow<Boolean> by lazy {
        if (SceneContainerFlag.isEnabled) {
            sceneInteractor.get().transitionState.map { it.isIdle(Overlays.Bouncer) }
            sceneInteractor.get().transitionState.map {
                it.isTransitioning(to = Overlays.Bouncer) || it.isIdle(Overlays.Bouncer)
            }
        } else {
            primaryBouncerInteractor.get().isShowing
        }