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

Commit 841bc493 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Adds sceneState to the logger

Bug: 395063194
Test: saw the new logs in logcat
Flag: com.android.systemui.scene_container
Change-Id: Id0c95022c7fd3123b71b790baf842c85e91607b3
parent 94b20ae3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ constructor(
        logger.logSceneChanged(
            from = currentSceneKey,
            to = resolvedScene,
            sceneState = sceneState,
            reason = loggingReason,
            isInstant = false,
        )
@@ -279,6 +280,7 @@ constructor(
        logger.logSceneChanged(
            from = currentSceneKey,
            to = resolvedScene,
            sceneState = null,
            reason = loggingReason,
            isInstant = true,
        )
+13 −6
Original line number Diff line number Diff line
@@ -45,23 +45,30 @@ class SceneLogger @Inject constructor(@SceneFrameworkLog private val logBuffer:
        )
    }

    fun logSceneChanged(from: SceneKey, to: SceneKey, reason: String, isInstant: Boolean) {
    fun logSceneChanged(
        from: SceneKey,
        to: SceneKey,
        sceneState: Any?,
        reason: String,
        isInstant: Boolean,
    ) {
        logBuffer.log(
            tag = TAG,
            level = LogLevel.INFO,
            messageInitializer = {
                str1 = from.toString()
                str2 = to.toString()
                str3 = reason
                str1 = "${from.debugName} → ${to.debugName}"
                str2 = reason
                str3 = sceneState?.toString()
                bool1 = isInstant
            },
            messagePrinter = {
                buildString {
                    append("Scene changed: $str1 → $str2")
                    append("Scene changed: $str1")
                    str3?.let { append(" (sceneState=$it)") }
                    if (isInstant) {
                        append(" (instant)")
                    }
                    append(", reason: $str3")
                    append(", reason: $str2")
                }
            },
        )
+1 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ constructor(
            logger.logSceneChanged(
                from = fromScene,
                to = toScene,
                sceneState = null,
                reason = "user interaction",
                isInstant = false,
            )