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

Commit 8bd1ed80 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Remove special case for replaced transitions

This CL removes a special case that was added to slim down the
STLState.currentTransitions when replacing a transition by another one.
This optimization was unnecessary and adds a mutation of
transitionStates where removed transitions were not logged as finished.
This premature optimization is not worth its cost given that it had
already caused a crash in the past that was fixed in ag/29881406.

Bug: 379281707
Test: atest PlatformComposeSceneTransitionLayoutTests
Flag: com.android.systemui.scene_container
Change-Id: Ide9fa14a9f1883b5a13ee792d84ef3a58a6923cc
parent 6a70258b
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -430,14 +430,6 @@ internal class MutableSceneTransitionLayoutStateImpl(
                    check(transitionStates.size == 1)
                    check(transitionStates[0] is TransitionState.Idle)
                    transitionStates = listOf(transition)
                } else if (currentState == transition.replacedTransition) {
                    // Replace the transition.
                    transitionStates =
                        transitionStates.subList(0, transitionStates.lastIndex) + transition

                    // Make sure it is removed from the finishedTransitions set if it was already
                    // finished.
                    finishedTransitions.remove(currentState)
                } else {
                    // Append the new transition.
                    transitionStates = transitionStates + transition
+3 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ class InterruptionHandlerTest {
        assertThat(state.currentTransitions)
            .comparingElementsUsing(FromToCurrentTriple)
            .containsExactly(
                // Initial transition, A => B.
                Triple(SceneA, SceneB, SceneB),

                // Initial transition reversed, B back to A.
                Triple(SceneA, SceneB, SceneA),