Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +4 −3 Original line number Diff line number Diff line Loading @@ -343,9 +343,8 @@ class DesktopTasksController( task.taskId ) val wct = WindowContainerTransaction() wct.setWindowingMode(task.token, WINDOWING_MODE_MULTI_WINDOW) wct.setBounds(task.token, Rect()) wct.setDensityDpi(task.token, getDefaultDensityDpi()) addMoveToSplitChanges(wct, task) if (Transitions.ENABLE_SHELL_TRANSITIONS) { transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */) } else { Loading Loading @@ -827,7 +826,9 @@ class DesktopTasksController( wct: WindowContainerTransaction, taskInfo: RunningTaskInfo ) { wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_MULTI_WINDOW) // Explicitly setting multi-window at task level interferes with animations. // Let task inherit windowing mode once transition is complete instead. wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_UNDEFINED) // The task's density may have been overridden in freeform; revert it here as we don't // want it overridden in multi-window. wct.setDensityDpi(taskInfo.token, getDefaultDensityDpi()) Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +10 −5 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; import com.android.wm.shell.recents.RecentsTransitionHandler; import com.android.wm.shell.recents.RecentsTransitionStateListener; import com.android.wm.shell.splitscreen.SplitScreen; import com.android.wm.shell.splitscreen.SplitScreen.StageType; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.KeyguardChangeListener; import com.android.wm.shell.sysui.ShellCommandHandler; Loading Loading @@ -238,7 +239,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { mSplitScreenController = splitScreenController; mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() { @Override public void onTaskStageChanged(int taskId, int stage, boolean visible) { public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) { if (visible) { DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId); if (decor != null && DesktopModeStatus.isEnabled() Loading Loading @@ -391,10 +392,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(mTaskId); final int id = v.getId(); if (id == R.id.close_window) { mTaskOperations.closeTask(mTaskToken); if (isTaskInSplitScreen(mTaskId)) { RunningTaskInfo remainingTask = getOtherSplitTask(mTaskId); mSplitScreenController.moveTaskToFullscreen(remainingTask.taskId); mSplitScreenController.moveTaskToFullscreen(getOtherSplitTask(mTaskId).taskId); } else { mTaskOperations.closeTask(mTaskToken); } } else if (id == R.id.back_button) { mTaskOperations.injectBackKey(); Loading @@ -417,8 +418,12 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { } decoration.closeHandleMenu(); } else if (id == R.id.fullscreen_button) { mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId)); decoration.closeHandleMenu(); if (isTaskInSplitScreen(mTaskId)) { mSplitScreenController.moveTaskToFullscreen(mTaskId); } else { mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId)); } } else if (id == R.id.split_screen_button) { decoration.closeHandleMenu(); mDesktopTasksController.ifPresent(c -> { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +4 −3 Original line number Diff line number Diff line Loading @@ -343,9 +343,8 @@ class DesktopTasksController( task.taskId ) val wct = WindowContainerTransaction() wct.setWindowingMode(task.token, WINDOWING_MODE_MULTI_WINDOW) wct.setBounds(task.token, Rect()) wct.setDensityDpi(task.token, getDefaultDensityDpi()) addMoveToSplitChanges(wct, task) if (Transitions.ENABLE_SHELL_TRANSITIONS) { transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */) } else { Loading Loading @@ -827,7 +826,9 @@ class DesktopTasksController( wct: WindowContainerTransaction, taskInfo: RunningTaskInfo ) { wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_MULTI_WINDOW) // Explicitly setting multi-window at task level interferes with animations. // Let task inherit windowing mode once transition is complete instead. wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_UNDEFINED) // The task's density may have been overridden in freeform; revert it here as we don't // want it overridden in multi-window. wct.setDensityDpi(taskInfo.token, getDefaultDensityDpi()) Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +10 −5 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; import com.android.wm.shell.recents.RecentsTransitionHandler; import com.android.wm.shell.recents.RecentsTransitionStateListener; import com.android.wm.shell.splitscreen.SplitScreen; import com.android.wm.shell.splitscreen.SplitScreen.StageType; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.KeyguardChangeListener; import com.android.wm.shell.sysui.ShellCommandHandler; Loading Loading @@ -238,7 +239,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { mSplitScreenController = splitScreenController; mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() { @Override public void onTaskStageChanged(int taskId, int stage, boolean visible) { public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) { if (visible) { DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId); if (decor != null && DesktopModeStatus.isEnabled() Loading Loading @@ -391,10 +392,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(mTaskId); final int id = v.getId(); if (id == R.id.close_window) { mTaskOperations.closeTask(mTaskToken); if (isTaskInSplitScreen(mTaskId)) { RunningTaskInfo remainingTask = getOtherSplitTask(mTaskId); mSplitScreenController.moveTaskToFullscreen(remainingTask.taskId); mSplitScreenController.moveTaskToFullscreen(getOtherSplitTask(mTaskId).taskId); } else { mTaskOperations.closeTask(mTaskToken); } } else if (id == R.id.back_button) { mTaskOperations.injectBackKey(); Loading @@ -417,8 +418,12 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel { } decoration.closeHandleMenu(); } else if (id == R.id.fullscreen_button) { mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId)); decoration.closeHandleMenu(); if (isTaskInSplitScreen(mTaskId)) { mSplitScreenController.moveTaskToFullscreen(mTaskId); } else { mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId)); } } else if (id == R.id.split_screen_button) { decoration.closeHandleMenu(); mDesktopTasksController.ifPresent(c -> { Loading