Loading packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractorTest.kt +34 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.se 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.Transition import com.android.systemui.scene.data.repository.setSceneTransition import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays Loading @@ -74,6 +75,7 @@ import com.android.systemui.user.data.model.SelectionStatus import com.android.systemui.user.data.repository.fakeUserRepository import com.android.systemui.util.mockito.eq import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf import org.junit.Before import org.junit.Test Loading Loading @@ -175,6 +177,38 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { ) } @Test @EnableSceneContainer @EnableFlags(FLAG_DREAMS_V2) fun faceAuthIsRequestedWhenTransitioningFromDreamToLockscreen_withSceneContainerEnabled() = kosmos.runTest { underTest.start() runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_LID) fakeFaceWakeUpTriggersConfig.setTriggerFaceAuthOnWakeUpFrom( setOf(WakeSleepReason.LID.powerManagerWakeReason) ) sceneInteractor.setTransitionState( MutableStateFlow(Transition(from = Scenes.Dream, to = Scenes.Lockscreen)) ) runCurrent() fakeKeyguardTransitionRepository.sendTransitionStep( TransitionStep( KeyguardState.UNDEFINED, KeyguardState.LOCKSCREEN, transitionState = TransitionState.STARTED, ) ) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo( Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED, true) ) } @Test fun whenFaceIsLockedOutAndNonBypassAnyAttemptsToTriggerFaceAuthMustProvideLockoutError() = kosmos.runTest { Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +6 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,12 @@ constructor( add(keyguardTransitionInteractor.transition(Edge.create(DOZING, LOCKSCREEN))) if (dreamsV2()) { add(keyguardTransitionInteractor.transition(Edge.create(DREAMING, LOCKSCREEN))) add( keyguardTransitionInteractor.transition( edge = Edge.create(Scenes.Dream, LOCKSCREEN), edgeWithoutSceneContainer = Edge.create(DREAMING, LOCKSCREEN), ) ) } } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractorTest.kt +34 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.se 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.Transition import com.android.systemui.scene.data.repository.setSceneTransition import com.android.systemui.scene.domain.interactor.sceneInteractor import com.android.systemui.scene.shared.model.Overlays Loading @@ -74,6 +75,7 @@ import com.android.systemui.user.data.model.SelectionStatus import com.android.systemui.user.data.repository.fakeUserRepository import com.android.systemui.util.mockito.eq import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf import org.junit.Before import org.junit.Test Loading Loading @@ -175,6 +177,38 @@ class DeviceEntryFaceAuthInteractorTest : SysuiTestCase() { ) } @Test @EnableSceneContainer @EnableFlags(FLAG_DREAMS_V2) fun faceAuthIsRequestedWhenTransitioningFromDreamToLockscreen_withSceneContainerEnabled() = kosmos.runTest { underTest.start() runCurrent() powerInteractor.setAwakeForTest(reason = PowerManager.WAKE_REASON_LID) fakeFaceWakeUpTriggersConfig.setTriggerFaceAuthOnWakeUpFrom( setOf(WakeSleepReason.LID.powerManagerWakeReason) ) sceneInteractor.setTransitionState( MutableStateFlow(Transition(from = Scenes.Dream, to = Scenes.Lockscreen)) ) runCurrent() fakeKeyguardTransitionRepository.sendTransitionStep( TransitionStep( KeyguardState.UNDEFINED, KeyguardState.LOCKSCREEN, transitionState = TransitionState.STARTED, ) ) runCurrent() assertThat(faceAuthRepository.runningAuthRequest.value) .isEqualTo( Pair(FaceAuthUiEvent.FACE_AUTH_UPDATED_KEYGUARD_VISIBILITY_CHANGED, true) ) } @Test fun whenFaceIsLockedOutAndNonBypassAnyAttemptsToTriggerFaceAuthMustProvideLockoutError() = kosmos.runTest { Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt +6 −1 Original line number Diff line number Diff line Loading @@ -170,7 +170,12 @@ constructor( add(keyguardTransitionInteractor.transition(Edge.create(DOZING, LOCKSCREEN))) if (dreamsV2()) { add(keyguardTransitionInteractor.transition(Edge.create(DREAMING, LOCKSCREEN))) add( keyguardTransitionInteractor.transition( edge = Edge.create(Scenes.Dream, LOCKSCREEN), edgeWithoutSceneContainer = Edge.create(DREAMING, LOCKSCREEN), ) ) } } Loading