summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt19
1 files changed, 6 insertions, 13 deletions
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 744e8c2eb06f..181474fa0590 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 @@ 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() {
- @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()
}
}