Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +16 −13 Original line number Diff line number Diff line Loading @@ -859,7 +859,9 @@ class DesktopTasksController( val requestRes = transitions.dispatchRequest(Binder(), requestInfo, /* skip= */ null) wct.merge(requestRes.second, true) desktopPipTransitionObserver.get().addPendingPipTransition( desktopPipTransitionObserver .get() .addPendingPipTransition( DesktopPipTransitionObserver.PendingPipTransition( token = freeformTaskTransitionStarter.startPipTransition(wct), taskId = taskInfo.taskId, Loading Loading @@ -1232,6 +1234,7 @@ class DesktopTasksController( pendingIntentBackgroundActivityStartMode = ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS launchBounds = bounds launchDisplayId = displayId if (DesktopModeFlags.ENABLE_SHELL_INITIAL_BOUNDS_REGRESSION_BUG_FIX.isTrue) { // Sets launch bounds size as flexible so core can recalculate. flexibleLaunchSize = true Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +31 −0 Original line number Diff line number Diff line Loading @@ -1525,6 +1525,37 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() assertThat(wct.hierarchyOps).hasSize(1) } @Test fun launchIntent_taskInDesktopMode_onSecondaryDisplay_transitionStarted() { setUpLandscapeDisplay() taskRepository.addDesk(SECOND_DISPLAY, deskId = 2) val intent = Intent().setComponent(homeComponentName) whenever( desktopMixedTransitionHandler.startLaunchTransition( eq(TRANSIT_OPEN), any(), anyOrNull(), anyOrNull(), anyOrNull(), ) ) .thenReturn(Binder()) controller.startLaunchIntentTransition(intent, Bundle.EMPTY, SECOND_DISPLAY) val wct = getLatestDesktopMixedTaskWct(type = TRANSIT_OPEN) // We expect two actions: open the app and start the desk assertThat(wct.hierarchyOps).hasSize(2) val hOps0 = wct.hierarchyOps[0] val hOps1 = wct.hierarchyOps[1] assertThat(hOps0.type).isEqualTo(HIERARCHY_OP_TYPE_PENDING_INTENT) val activityOptions0 = ActivityOptions.fromBundle(hOps0.launchOptions) assertThat(activityOptions0.launchDisplayId).isEqualTo(SECOND_DISPLAY) assertThat(hOps1.type).isEqualTo(HIERARCHY_OP_TYPE_PENDING_INTENT) val activityOptions1 = ActivityOptions.fromBundle(hOps1.launchOptions) assertThat(activityOptions1.launchDisplayId).isEqualTo(SECOND_DISPLAY) } @Test @EnableFlags(Flags.FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS) fun addMoveToDeskTaskChanges_landscapeDevice_userFullscreenOverride_defaultPortraitBounds() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +16 −13 Original line number Diff line number Diff line Loading @@ -859,7 +859,9 @@ class DesktopTasksController( val requestRes = transitions.dispatchRequest(Binder(), requestInfo, /* skip= */ null) wct.merge(requestRes.second, true) desktopPipTransitionObserver.get().addPendingPipTransition( desktopPipTransitionObserver .get() .addPendingPipTransition( DesktopPipTransitionObserver.PendingPipTransition( token = freeformTaskTransitionStarter.startPipTransition(wct), taskId = taskInfo.taskId, Loading Loading @@ -1232,6 +1234,7 @@ class DesktopTasksController( pendingIntentBackgroundActivityStartMode = ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS launchBounds = bounds launchDisplayId = displayId if (DesktopModeFlags.ENABLE_SHELL_INITIAL_BOUNDS_REGRESSION_BUG_FIX.isTrue) { // Sets launch bounds size as flexible so core can recalculate. flexibleLaunchSize = true Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +31 −0 Original line number Diff line number Diff line Loading @@ -1525,6 +1525,37 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() assertThat(wct.hierarchyOps).hasSize(1) } @Test fun launchIntent_taskInDesktopMode_onSecondaryDisplay_transitionStarted() { setUpLandscapeDisplay() taskRepository.addDesk(SECOND_DISPLAY, deskId = 2) val intent = Intent().setComponent(homeComponentName) whenever( desktopMixedTransitionHandler.startLaunchTransition( eq(TRANSIT_OPEN), any(), anyOrNull(), anyOrNull(), anyOrNull(), ) ) .thenReturn(Binder()) controller.startLaunchIntentTransition(intent, Bundle.EMPTY, SECOND_DISPLAY) val wct = getLatestDesktopMixedTaskWct(type = TRANSIT_OPEN) // We expect two actions: open the app and start the desk assertThat(wct.hierarchyOps).hasSize(2) val hOps0 = wct.hierarchyOps[0] val hOps1 = wct.hierarchyOps[1] assertThat(hOps0.type).isEqualTo(HIERARCHY_OP_TYPE_PENDING_INTENT) val activityOptions0 = ActivityOptions.fromBundle(hOps0.launchOptions) assertThat(activityOptions0.launchDisplayId).isEqualTo(SECOND_DISPLAY) assertThat(hOps1.type).isEqualTo(HIERARCHY_OP_TYPE_PENDING_INTENT) val activityOptions1 = ActivityOptions.fromBundle(hOps1.launchOptions) assertThat(activityOptions1.launchDisplayId).isEqualTo(SECOND_DISPLAY) } @Test @EnableFlags(Flags.FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS) fun addMoveToDeskTaskChanges_landscapeDevice_userFullscreenOverride_defaultPortraitBounds() { Loading