Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractor.kt +2 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,8 @@ constructor( .map { step -> step.to } .shareIn(scope, SharingStarted.Eagerly, replay = 1) val currentTransitionInfo: StateFlow<TransitionInfo> = repository.currentTransitionInfoInternal /** The from state of the last [TransitionState.STARTED] transition. */ // TODO: is it performant to have several SharedFlows side by side instead of one? @SuppressLint("SharedFlowCreation") Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/scenetransition/LockscreenSceneTransitionInteractor.kt +5 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ constructor( val newTransition = TransitionInfo( ownerName = this::class.java.simpleName, from = transitionInteractor.getStartedState(), from = transitionInteractor.currentTransitionInfo.value.to, to = state, animator = null, modeOnCanceled = TransitionModeOnCanceled.REVERSE Loading @@ -150,7 +150,7 @@ constructor( private suspend fun handleTransition(transition: ObservableTransitionState.Transition) { if (transition.fromScene == Scenes.Lockscreen) { if (currentTransitionId != null) { val currentToState = transitionInteractor.getStartedState() val currentToState = transitionInteractor.currentTransitionInfo.value.to if (currentToState == UNDEFINED) { transitionKtfTo(transitionInteractor.getStartedFromState()) } Loading @@ -169,6 +169,8 @@ constructor( } private suspend fun transitionKtfTo(state: KeyguardState) { // TODO(b/330311871): This is based on a sharedFlow and thus might not be up-to-date and // cause a race condition. (There is no known scenario that is currently affected.) val currentTransition = transitionInteractor.transitionState.value if (currentTransition.isFinishedIn(state)) { // This is already the state we want to be in Loading Loading @@ -199,7 +201,7 @@ constructor( } private suspend fun startTransitionFromLockscreen() { val currentState = transitionInteractor.getStartedState() val currentState = transitionInteractor.currentTransitionInfo.value.to val newTransition = TransitionInfo( ownerName = this::class.java.simpleName, Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/scenetransition/LockscreenSceneTransitionInteractorTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.runner.RunWith @SmallTest Loading Loading @@ -1149,7 +1148,6 @@ class LockscreenSceneTransitionInteractorTest : SysuiTestCase() { * * In STL there is no guarantee that transitions settle in Idle before continuing. */ @Ignore("Suffers from a race condition that will be fixed in followup CL") @Test fun transition_from_ls_scene_interrupted_by_other_from_ls_transition() = testScope.runTest { Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionInteractor.kt +2 −0 Original line number Diff line number Diff line Loading @@ -218,6 +218,8 @@ constructor( .map { step -> step.to } .shareIn(scope, SharingStarted.Eagerly, replay = 1) val currentTransitionInfo: StateFlow<TransitionInfo> = repository.currentTransitionInfoInternal /** The from state of the last [TransitionState.STARTED] transition. */ // TODO: is it performant to have several SharedFlows side by side instead of one? @SuppressLint("SharedFlowCreation") Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/scenetransition/LockscreenSceneTransitionInteractor.kt +5 −3 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ constructor( val newTransition = TransitionInfo( ownerName = this::class.java.simpleName, from = transitionInteractor.getStartedState(), from = transitionInteractor.currentTransitionInfo.value.to, to = state, animator = null, modeOnCanceled = TransitionModeOnCanceled.REVERSE Loading @@ -150,7 +150,7 @@ constructor( private suspend fun handleTransition(transition: ObservableTransitionState.Transition) { if (transition.fromScene == Scenes.Lockscreen) { if (currentTransitionId != null) { val currentToState = transitionInteractor.getStartedState() val currentToState = transitionInteractor.currentTransitionInfo.value.to if (currentToState == UNDEFINED) { transitionKtfTo(transitionInteractor.getStartedFromState()) } Loading @@ -169,6 +169,8 @@ constructor( } private suspend fun transitionKtfTo(state: KeyguardState) { // TODO(b/330311871): This is based on a sharedFlow and thus might not be up-to-date and // cause a race condition. (There is no known scenario that is currently affected.) val currentTransition = transitionInteractor.transitionState.value if (currentTransition.isFinishedIn(state)) { // This is already the state we want to be in Loading Loading @@ -199,7 +201,7 @@ constructor( } private suspend fun startTransitionFromLockscreen() { val currentState = transitionInteractor.getStartedState() val currentState = transitionInteractor.currentTransitionInfo.value.to val newTransition = TransitionInfo( ownerName = this::class.java.simpleName, Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/scenetransition/LockscreenSceneTransitionInteractorTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.launch import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.runner.RunWith @SmallTest Loading Loading @@ -1149,7 +1148,6 @@ class LockscreenSceneTransitionInteractorTest : SysuiTestCase() { * * In STL there is no guarantee that transitions settle in Idle before continuing. */ @Ignore("Suffers from a race condition that will be fixed in followup CL") @Test fun transition_from_ls_scene_interrupted_by_other_from_ls_transition() = testScope.runTest { Loading