Merge "Disable letterbox education during app compat flicker tests" into main
diff --git a/libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt b/libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt
index 744e8c2..181474f 100644
--- a/libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt
+++ b/libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt
@@ -57,25 +57,18 @@
         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() {
-                @Throws(Throwable::class)
-                override fun evaluate() {
+        return object : Statement() {
+            @Throws(Throwable::class)
+            override fun evaluate() {
+                try {
                     base!!.evaluate()
+                } finally {
+                    resetLetterboxStyle()
                 }
             }
-        } finally {
-            if (hasLetterboxEducationStateChanged) {
-                execAdb(
-                    "wm set-letterbox-style --isEducationEnabled " + isLetterboxEducationEnabled
-                )
-            }
-            resetLetterboxStyle()
         }
     }