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

Commit d5be72c2 authored by Eghosa Ewansiha-Vlachavas's avatar Eghosa Ewansiha-Vlachavas Committed by Android (Google) Code Review
Browse files

Merge "Disable letterbox education during app compat flicker tests" into main

parents aba7c6d2 f51d8486
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
@@ -57,27 +57,20 @@ class LetterboxRule(
        resetLetterboxStyle()
        _letterboxStyle = mapLetterboxStyle()
        val isLetterboxEducationEnabled = _letterboxStyle.getValue("Is education enabled")
        var hasLetterboxEducationStateChanged = false
        if ("$withLetterboxEducationEnabled" != isLetterboxEducationEnabled) {
            hasLetterboxEducationStateChanged = true
            execAdb("wm set-letterbox-style --isEducationEnabled " + withLetterboxEducationEnabled)
        }
        return try {
            object : Statement() {
        return object : Statement() {
            @Throws(Throwable::class)
            override fun evaluate() {
                try {
                    base!!.evaluate()
                }
            }
                } finally {
            if (hasLetterboxEducationStateChanged) {
                execAdb(
                    "wm set-letterbox-style --isEducationEnabled " + isLetterboxEducationEnabled
                )
            }
                    resetLetterboxStyle()
                }
            }
        }
    }

    private fun mapLetterboxStyle(): HashMap<String, String> {
        val res = execAdb("wm get-letterbox-style")