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

Commit 6a70258b authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

Add logs when starting/finishing a transition

This CL adds simple logs when starting or finishing a transition. These
logs should be useful but also they shouldn't spam logcat too much,
which is why they are always enabled.

Bug: 373799480
Test: Manual, saw logs when performing transitions
Flag: com.android.systemui.scene_container
Change-Id: I0440b00de0dccfe6628b316d890cab48d4a94a40
parent e9407837
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -354,6 +354,7 @@ internal class MutableSceneTransitionLayoutStateImpl(
    }

    override suspend fun startTransition(transition: TransitionState.Transition, chain: Boolean) {
        Log.i(TAG, "startTransition(transition=$transition, chain=$chain)")
        checkThread()

        // Prepare the transition before starting it. This is outside of the try/finally block on
@@ -486,6 +487,7 @@ internal class MutableSceneTransitionLayoutStateImpl(
            return
        }

        Log.i(TAG, "finishTransition(transition=$transition)")
        check(transitionStates.fastAll { it is TransitionState.Transition })

        // Mark this transition as finished.
@@ -513,13 +515,10 @@ internal class MutableSceneTransitionLayoutStateImpl(
        // If all transitions are finished, we are idle.
        if (i == nStates) {
            check(finishedTransitions.isEmpty())
            this.transitionStates =
                listOf(
                    TransitionState.Idle(
                        lastTransition.currentScene,
                        lastTransition.currentOverlays,
                    )
                )
            val idle =
                TransitionState.Idle(lastTransition.currentScene, lastTransition.currentOverlays)
            Log.i(TAG, "all transitions finished. idle=$idle")
            this.transitionStates = listOf(idle)
        } else if (i > 0) {
            this.transitionStates = transitionStates.subList(fromIndex = i, toIndex = nStates)
        }
+14 −0
Original line number Diff line number Diff line
@@ -90,6 +90,10 @@ sealed interface TransitionState {
                    // The set of overlays does not change in a [ChangeCurrentScene] transition.
                    return currentOverlaysWhenTransitionStarted
                }

            override fun toString(): String {
                return "ChangeScene(fromScene=$fromScene, toScene=$toScene)"
            }
        }

        /**
@@ -146,6 +150,12 @@ sealed interface TransitionState {
                    currentOverlaysWhenTransitionStarted - overlay
                }
            }

            override fun toString(): String {
                val isShowing = overlay == toContent
                return "ShowOrHideOverlay(overlay=$overlay, fromOrToScene=$fromOrToScene, " +
                    "isShowing=$isShowing)"
            }
        }

        /** We are transitioning from [fromOverlay] to [toOverlay]. */
@@ -194,6 +204,10 @@ sealed interface TransitionState {
                    add(include)
                }
            }

            override fun toString(): String {
                return "ReplaceOverlay(fromOverlay=$fromOverlay, toOverlay=$toOverlay)"
            }
        }

        /**