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

Commit 18147803 authored by Ale Nijamkin's avatar Ale Nijamkin
Browse files

[flexiglass] Fixes logging for falsing

The logic that was rejecting scene transitions due to falsing was
logging a success instead of a rejection.

Bug: 404470548
Test: manually verified that successful manual transitions log correctly
and that falsing-rejected manualk transitions also do
Flag: com.android.systemui.scene_container

Change-Id: Ie8996dee482112c8f620bc4a7f7d3db6a3e84ce2
parent ed880e41
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ class SceneLogger @Inject constructor(@SceneFrameworkLog private val logBuffer:
    fun logSceneChangeRejection(
        from: ContentKey?,
        to: ContentKey?,
        originalChangeReason: String,
        originalChangeReason: String?,
        rejectionReason: String,
    ) {
        logBuffer.log(
@@ -113,8 +113,10 @@ class SceneLogger @Inject constructor(@SceneFrameworkLog private val logBuffer:
                        }
                    )
                    append("change $str1 because \"$str2\"")
                    if (str3 != null) {
                        append(" (original change reason: \"$str3\")")
                    }
                }
            },
        )
    }
@@ -136,8 +138,11 @@ class SceneLogger @Inject constructor(@SceneFrameworkLog private val logBuffer:
                logBuffer.log(
                    tag = TAG,
                    level = LogLevel.INFO,
                    messageInitializer = { str1 = transitionState.currentScene.toString() },
                    messagePrinter = { "Scene transition idle on: $str1" },
                    messageInitializer = {
                        str1 = transitionState.currentScene.toString()
                        str2 = transitionState.currentOverlays.joinToString()
                    },
                    messagePrinter = { "Scene transition idle on: $str1, overlays: $str2" },
                )
            }
        }
+18 −9
Original line number Diff line number Diff line
@@ -219,7 +219,8 @@ constructor(
     * it being a false touch.
     */
    fun canChangeScene(toScene: SceneKey): Boolean {
        return isInteractionAllowedByFalsing(toScene).also {
        return isInteractionAllowedByFalsing(toScene).also { sceneChangeAllowed ->
            if (sceneChangeAllowed) {
                // A scene change is guaranteed; log it.
                logger.logSceneChanged(
                    from = currentScene.value,
@@ -228,6 +229,14 @@ constructor(
                    reason = "user interaction",
                    isInstant = false,
                )
            } else {
                logger.logSceneChangeRejection(
                    from = currentScene.value,
                    to = toScene,
                    originalChangeReason = null,
                    rejectionReason = "Falsing: false touch detected",
                )
            }
        }
    }