Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +21 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,27 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, "startTasks: task1=%d task2=%d position=%d snapPosition=%d", taskId1, taskId2, splitPosition, snapPosition); final WindowContainerTransaction wct = new WindowContainerTransaction(); // If the two tasks are already in split screen on external display, only reparent the // split root to the default display if the app pair is clicked on default display. // TODO(b/393217881): cover more cases and extract this to a new method when split screen // in connected display is fully supported. if (enableNonDefaultDisplaySplit()) { DisplayAreaInfo displayAreaInfo = mRootTDAOrganizer.getDisplayAreaInfo(DEFAULT_DISPLAY); ActivityManager.RunningTaskInfo taskInfo1 = mTaskOrganizer.getRunningTaskInfo(taskId1); ActivityManager.RunningTaskInfo taskInfo2 = mTaskOrganizer.getRunningTaskInfo(taskId2); if (displayAreaInfo != null && taskInfo1 != null && taskInfo2 != null && getStageOfTask(taskId1) != STAGE_TYPE_UNDEFINED && getStageOfTask(taskId2) != STAGE_TYPE_UNDEFINED && taskInfo1.displayId != DEFAULT_DISPLAY && taskInfo1.displayId == taskInfo2.displayId) { wct.reparent(mRootTaskInfo.token, displayAreaInfo.token, true); mTaskOrganizer.applyTransaction(wct); return; } } if (taskId2 == INVALID_TASK_ID) { startSingleTask(taskId1, options1, wct, remoteTransition); return; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +21 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,27 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, "startTasks: task1=%d task2=%d position=%d snapPosition=%d", taskId1, taskId2, splitPosition, snapPosition); final WindowContainerTransaction wct = new WindowContainerTransaction(); // If the two tasks are already in split screen on external display, only reparent the // split root to the default display if the app pair is clicked on default display. // TODO(b/393217881): cover more cases and extract this to a new method when split screen // in connected display is fully supported. if (enableNonDefaultDisplaySplit()) { DisplayAreaInfo displayAreaInfo = mRootTDAOrganizer.getDisplayAreaInfo(DEFAULT_DISPLAY); ActivityManager.RunningTaskInfo taskInfo1 = mTaskOrganizer.getRunningTaskInfo(taskId1); ActivityManager.RunningTaskInfo taskInfo2 = mTaskOrganizer.getRunningTaskInfo(taskId2); if (displayAreaInfo != null && taskInfo1 != null && taskInfo2 != null && getStageOfTask(taskId1) != STAGE_TYPE_UNDEFINED && getStageOfTask(taskId2) != STAGE_TYPE_UNDEFINED && taskInfo1.displayId != DEFAULT_DISPLAY && taskInfo1.displayId == taskInfo2.displayId) { wct.reparent(mRootTaskInfo.token, displayAreaInfo.token, true); mTaskOrganizer.applyTransaction(wct); return; } } if (taskId2 == INVALID_TASK_ID) { startSingleTask(taskId1, options1, wct, remoteTransition); return; Loading