Loading libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/roundedcorners/RoundedCornersLetterboxController.kt +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.graphics.Rect import android.view.SurfaceControl import android.window.WindowContainerToken import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.common.ShellExecutor import com.android.wm.shell.compatui.letterbox.LetterboxController import com.android.wm.shell.compatui.letterbox.LetterboxKey Loading Loading @@ -77,7 +78,13 @@ constructor( ) { roundedCornersMap.runOnItem( key.taskId, onFound = { item -> item.setCornersVisibility(animExecutor, visible, immediate = true) }, onFound = { item -> item.setCornersVisibility( animExecutor, visible, immediate = !Flags.appCompatRefactoringRoundedCornersAnimation(), ) }, ) } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/roundedcorners/RoundedCornersLetterboxControllerTest.kt +29 −3 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.wm.shell.compatui.letterbox.roundedcorners import android.content.res.Configuration import android.graphics.Rect import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest import com.android.window.flags.Flags import com.android.wm.shell.ShellTestCase import com.android.wm.shell.TestShellExecutor import com.android.wm.shell.compatui.letterbox.LetterboxController Loading Loading @@ -109,7 +112,26 @@ class RoundedCornersLetterboxControllerTest : ShellTestCase() { } @Test fun `Only existing surfaces receive visibility update`() { @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING_ROUNDED_CORNERS_ANIMATION) fun `Only existing surfaces receive visibility update with animation`() { runTestScenario { r -> r.configureRepository() r.configureRepository(taskId = ANOTHER_TASK_ID) r.sendCreateSurfaceRequest() r.sendUpdateSurfaceVisibilityRequest(visible = true) r.sendUpdateSurfaceVisibilityRequest(visible = true, taskId = ANOTHER_TASK_ID) r.checkRoundedCornersVisibilityUpdated( times = 1, expectedVisibility = true, immediate = false ) } } @Test @DisableFlags(Flags.FLAG_APP_COMPAT_REFACTORING_ROUNDED_CORNERS_ANIMATION) fun `Only existing surfaces receive visibility update without animation`() { runTestScenario { r -> r.configureRepository() r.configureRepository(taskId = ANOTHER_TASK_ID) Loading Loading @@ -191,11 +213,15 @@ class RoundedCornersLetterboxControllerTest : ShellTestCase() { ) } fun checkRoundedCornersVisibilityUpdated(times: Int = 1, expectedVisibility: Boolean) { fun checkRoundedCornersVisibilityUpdated( times: Int = 1, expectedVisibility: Boolean, immediate: Boolean = true ) { verify(roundedCornersSurface, times(times)).setCornersVisibility( any(), eq(expectedVisibility), eq(true) eq(immediate) ) } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/roundedcorners/RoundedCornersLetterboxController.kt +8 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.graphics.Rect import android.view.SurfaceControl import android.window.WindowContainerToken import com.android.internal.protolog.ProtoLog import com.android.window.flags.Flags import com.android.wm.shell.common.ShellExecutor import com.android.wm.shell.compatui.letterbox.LetterboxController import com.android.wm.shell.compatui.letterbox.LetterboxKey Loading Loading @@ -77,7 +78,13 @@ constructor( ) { roundedCornersMap.runOnItem( key.taskId, onFound = { item -> item.setCornersVisibility(animExecutor, visible, immediate = true) }, onFound = { item -> item.setCornersVisibility( animExecutor, visible, immediate = !Flags.appCompatRefactoringRoundedCornersAnimation(), ) }, ) } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/roundedcorners/RoundedCornersLetterboxControllerTest.kt +29 −3 Original line number Diff line number Diff line Loading @@ -18,8 +18,11 @@ package com.android.wm.shell.compatui.letterbox.roundedcorners import android.content.res.Configuration import android.graphics.Rect import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.testing.AndroidTestingRunner import androidx.test.filters.SmallTest import com.android.window.flags.Flags import com.android.wm.shell.ShellTestCase import com.android.wm.shell.TestShellExecutor import com.android.wm.shell.compatui.letterbox.LetterboxController Loading Loading @@ -109,7 +112,26 @@ class RoundedCornersLetterboxControllerTest : ShellTestCase() { } @Test fun `Only existing surfaces receive visibility update`() { @EnableFlags(Flags.FLAG_APP_COMPAT_REFACTORING_ROUNDED_CORNERS_ANIMATION) fun `Only existing surfaces receive visibility update with animation`() { runTestScenario { r -> r.configureRepository() r.configureRepository(taskId = ANOTHER_TASK_ID) r.sendCreateSurfaceRequest() r.sendUpdateSurfaceVisibilityRequest(visible = true) r.sendUpdateSurfaceVisibilityRequest(visible = true, taskId = ANOTHER_TASK_ID) r.checkRoundedCornersVisibilityUpdated( times = 1, expectedVisibility = true, immediate = false ) } } @Test @DisableFlags(Flags.FLAG_APP_COMPAT_REFACTORING_ROUNDED_CORNERS_ANIMATION) fun `Only existing surfaces receive visibility update without animation`() { runTestScenario { r -> r.configureRepository() r.configureRepository(taskId = ANOTHER_TASK_ID) Loading Loading @@ -191,11 +213,15 @@ class RoundedCornersLetterboxControllerTest : ShellTestCase() { ) } fun checkRoundedCornersVisibilityUpdated(times: Int = 1, expectedVisibility: Boolean) { fun checkRoundedCornersVisibilityUpdated( times: Int = 1, expectedVisibility: Boolean, immediate: Boolean = true ) { verify(roundedCornersSurface, times(times)).setCornersVisibility( any(), eq(expectedVisibility), eq(true) eq(immediate) ) } Loading