Loading libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt +6 −13 Original line number Diff line number Diff line Loading @@ -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") Loading Loading
libs/WindowManager/Shell/tests/flicker/appcompat/src/com/android/wm/shell/flicker/appcompat/LetterboxRule.kt +6 −13 Original line number Diff line number Diff line Loading @@ -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") Loading