Loading libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleControllerImpl.kt +2 −2 Original line number Diff line number Diff line Loading @@ -41,11 +41,11 @@ class LetterboxLifecycleControllerImpl( if (event.letterboxBounds != null) { // In this case the top Activity is letterboxed. letterboxModeStrategy.configureLetterboxMode() event.leash?.let { leash -> event.taskLeash?.let { taskLeash -> createLetterboxSurface( key, startTransaction, leash, taskLeash, event.containerToken ) } Loading libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleEvent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ data class LetterboxLifecycleEvent( val taskBounds: Rect, val letterboxBounds: Rect? = null, val containerToken: WindowContainerToken? = null, val leash: SurfaceControl? = null, val taskLeash: SurfaceControl? = null, ) /** Loading Loading @@ -91,6 +91,6 @@ fun Change.toLetterboxLifecycleEvent(): LetterboxLifecycleEvent { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = taskInfo?.token, leash = leash taskLeash = leash ) } libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/TaskInfoLetterboxLifecycleEventFactory.kt +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class TaskInfoLetterboxLifecycleEventFactory : LetterboxLifecycleEventFactory { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = ti.token, leash = change.leash taskLeash = change.leash ) } return null Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleControllerImplTest.kt +7 −7 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { r.createLifecycleEvent( type = LetterboxLifecycleEventType.OPEN, letterboxBounds = Rect(500, 0, 800, 1800), letterboxActivityLeash = null eventTaskLeash = null ) ) r.verifyCreateLetterboxSurface(expected = false) Loading @@ -99,7 +99,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { r.createLifecycleEvent( type = LetterboxLifecycleEventType.OPEN, letterboxBounds = Rect(500, 0, 800, 1800), letterboxActivityLeash = null eventTaskLeash = null ) ) r.verifyUpdateLetterboxSurfaceBounds( Loading @@ -125,7 +125,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { private val startTransaction: Transaction private val finishTransaction: Transaction private val token: WindowContainerToken private val leash: SurfaceControl private val taskLeash: SurfaceControl companion object { @JvmStatic Loading @@ -144,7 +144,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { startTransaction = mock<Transaction>() finishTransaction = mock<Transaction>() token = mock<WindowContainerToken>() leash = mock<SurfaceControl>() taskLeash = mock<SurfaceControl>() lifecycleController = LetterboxLifecycleControllerImpl( letterboxController, letterboxModeStrategy Loading @@ -158,7 +158,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { taskBounds: Rect = TASK_BOUNDS, letterboxBounds: Rect? = null, letterboxActivityToken: WindowContainerToken = token, letterboxActivityLeash: SurfaceControl? = leash eventTaskLeash: SurfaceControl? = taskLeash ): LetterboxLifecycleEvent = LetterboxLifecycleEvent( type = type, displayId = displayId, Loading @@ -166,7 +166,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = letterboxActivityToken, leash = letterboxActivityLeash taskLeash = eventTaskLeash ) fun invokeLifecycleControllerWith(event: LetterboxLifecycleEvent) { Loading @@ -188,7 +188,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { ).createLetterboxSurface( eq(LetterboxKey(displayId, taskId)), eq(startTransaction), eq(leash), eq(taskLeash), eq(token) ) } Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleEventTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ class LetterboxLifecycleEventTest : ShellTestCase() { } @Test fun `Use correct Lash`() { fun `Use correct Leash for creation`() { runTestScenario { r -> val testLeash: SurfaceControl = mock() r.configureChange( Loading @@ -154,7 +154,7 @@ class LetterboxLifecycleEventTest : ShellTestCase() { leash = testLeash ) r.createLetterboxLifecycleEvent() r.checkLetterboxActivityLeash(expected = testLeash) r.checkTaskLeash(expected = testLeash) } } Loading Loading @@ -253,8 +253,8 @@ class LetterboxLifecycleEventTest : ShellTestCase() { assertEquals(expected, event?.containerToken) } fun checkLetterboxActivityLeash(expected: SurfaceControl?) { assertEquals(expected, event?.leash) fun checkTaskLeash(expected: SurfaceControl?) { assertEquals(expected, event?.taskLeash) } fun checkLetterboxKey(expected: LetterboxKey) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleControllerImpl.kt +2 −2 Original line number Diff line number Diff line Loading @@ -41,11 +41,11 @@ class LetterboxLifecycleControllerImpl( if (event.letterboxBounds != null) { // In this case the top Activity is letterboxed. letterboxModeStrategy.configureLetterboxMode() event.leash?.let { leash -> event.taskLeash?.let { taskLeash -> createLetterboxSurface( key, startTransaction, leash, taskLeash, event.containerToken ) } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleEvent.kt +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ data class LetterboxLifecycleEvent( val taskBounds: Rect, val letterboxBounds: Rect? = null, val containerToken: WindowContainerToken? = null, val leash: SurfaceControl? = null, val taskLeash: SurfaceControl? = null, ) /** Loading Loading @@ -91,6 +91,6 @@ fun Change.toLetterboxLifecycleEvent(): LetterboxLifecycleEvent { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = taskInfo?.token, leash = leash taskLeash = leash ) }
libs/WindowManager/Shell/src/com/android/wm/shell/compatui/letterbox/lifecycle/TaskInfoLetterboxLifecycleEventFactory.kt +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ class TaskInfoLetterboxLifecycleEventFactory : LetterboxLifecycleEventFactory { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = ti.token, leash = change.leash taskLeash = change.leash ) } return null Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleControllerImplTest.kt +7 −7 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { r.createLifecycleEvent( type = LetterboxLifecycleEventType.OPEN, letterboxBounds = Rect(500, 0, 800, 1800), letterboxActivityLeash = null eventTaskLeash = null ) ) r.verifyCreateLetterboxSurface(expected = false) Loading @@ -99,7 +99,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { r.createLifecycleEvent( type = LetterboxLifecycleEventType.OPEN, letterboxBounds = Rect(500, 0, 800, 1800), letterboxActivityLeash = null eventTaskLeash = null ) ) r.verifyUpdateLetterboxSurfaceBounds( Loading @@ -125,7 +125,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { private val startTransaction: Transaction private val finishTransaction: Transaction private val token: WindowContainerToken private val leash: SurfaceControl private val taskLeash: SurfaceControl companion object { @JvmStatic Loading @@ -144,7 +144,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { startTransaction = mock<Transaction>() finishTransaction = mock<Transaction>() token = mock<WindowContainerToken>() leash = mock<SurfaceControl>() taskLeash = mock<SurfaceControl>() lifecycleController = LetterboxLifecycleControllerImpl( letterboxController, letterboxModeStrategy Loading @@ -158,7 +158,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { taskBounds: Rect = TASK_BOUNDS, letterboxBounds: Rect? = null, letterboxActivityToken: WindowContainerToken = token, letterboxActivityLeash: SurfaceControl? = leash eventTaskLeash: SurfaceControl? = taskLeash ): LetterboxLifecycleEvent = LetterboxLifecycleEvent( type = type, displayId = displayId, Loading @@ -166,7 +166,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { taskBounds = taskBounds, letterboxBounds = letterboxBounds, containerToken = letterboxActivityToken, leash = letterboxActivityLeash taskLeash = eventTaskLeash ) fun invokeLifecycleControllerWith(event: LetterboxLifecycleEvent) { Loading @@ -188,7 +188,7 @@ class LetterboxLifecycleControllerImplTest : ShellTestCase() { ).createLetterboxSurface( eq(LetterboxKey(displayId, taskId)), eq(startTransaction), eq(leash), eq(taskLeash), eq(token) ) } Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/letterbox/lifecycle/LetterboxLifecycleEventTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ class LetterboxLifecycleEventTest : ShellTestCase() { } @Test fun `Use correct Lash`() { fun `Use correct Leash for creation`() { runTestScenario { r -> val testLeash: SurfaceControl = mock() r.configureChange( Loading @@ -154,7 +154,7 @@ class LetterboxLifecycleEventTest : ShellTestCase() { leash = testLeash ) r.createLetterboxLifecycleEvent() r.checkLetterboxActivityLeash(expected = testLeash) r.checkTaskLeash(expected = testLeash) } } Loading Loading @@ -253,8 +253,8 @@ class LetterboxLifecycleEventTest : ShellTestCase() { assertEquals(expected, event?.containerToken) } fun checkLetterboxActivityLeash(expected: SurfaceControl?) { assertEquals(expected, event?.leash) fun checkTaskLeash(expected: SurfaceControl?) { assertEquals(expected, event?.taskLeash) } fun checkLetterboxKey(expected: LetterboxKey) { Loading