Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −2 Original line number Diff line number Diff line Loading @@ -360,8 +360,12 @@ oneway interface IStatusBar /** Shows rear display educational dialog */ void showRearDisplayDialog(int currentBaseState); /** Called when requested to go to fullscreen from the active split app. */ void goToFullscreenFromSplit(); /** * Called when requested to go to fullscreen from the focused app. * * @param displayId the id of the current display. */ void moveFocusedTaskToFullscreen(int displayId); /** * Enters stage split from a current running app. Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMode.java +2 −0 Original line number Diff line number Diff line Loading @@ -51,4 +51,6 @@ public interface DesktopMode { /** Called when requested to go to desktop mode from the current focused app. */ void enterDesktop(int displayId); /** Called when requested to go to fullscreen from the current focused desktop app. */ void moveFocusedTaskToFullscreen(int displayId); } libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +18 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,18 @@ class DesktopTasksController( } } /** Enter fullscreen by moving the focused freeform task in given `displayId` to fullscreen. */ fun enterFullscreen(displayId: Int) { if (DesktopModeStatus.isEnabled()) { shellTaskOrganizer .getRunningTasks(displayId) .find { taskInfo -> taskInfo.isFocused && taskInfo.windowingMode == WINDOWING_MODE_FREEFORM } ?.let { moveToFullscreenWithAnimation(it, it.positionInParent) } } } /** Move a desktop app to split screen. */ fun moveToSplit(task: RunningTaskInfo) { KtProtoLog.v( Loading Loading @@ -1108,6 +1120,12 @@ class DesktopTasksController( this@DesktopTasksController.enterDesktop(displayId) } } override fun moveFocusedTaskToFullscreen(displayId: Int) { mainExecutor.execute { this@DesktopTasksController.enterFullscreen(displayId) } } } /** The interface for calls from outside the host process. */ Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +3 −1 Original line number Diff line number Diff line Loading @@ -476,8 +476,10 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } public void goToFullscreenFromSplit() { if (mStageCoordinator.isSplitActive()) { mStageCoordinator.goToFullscreenFromSplit(); } } /** Move the specified task to fullscreen, regardless of focus state. */ public void moveTaskToFullscreen(int taskId, int exitReason) { Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -781,6 +781,23 @@ class DesktopTasksControllerTest : ShellTestCase() { ) } @Test fun moveFocusedTaskToFullscreen() { val task1 = setUpFreeformTask() val task2 = setUpFreeformTask() val task3 = setUpFreeformTask() task1.isFocused = false task2.isFocused = true task3.isFocused = false controller.enterFullscreen(DEFAULT_DISPLAY) val wct = getLatestExitDesktopWct() assertThat(wct.changes[task2.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_FULLSCREEN) } private fun setUpFreeformTask(displayId: Int = DEFAULT_DISPLAY): RunningTaskInfo { val task = createFreeformTask(displayId) whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task) Loading Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +6 −2 Original line number Diff line number Diff line Loading @@ -360,8 +360,12 @@ oneway interface IStatusBar /** Shows rear display educational dialog */ void showRearDisplayDialog(int currentBaseState); /** Called when requested to go to fullscreen from the active split app. */ void goToFullscreenFromSplit(); /** * Called when requested to go to fullscreen from the focused app. * * @param displayId the id of the current display. */ void moveFocusedTaskToFullscreen(int displayId); /** * Enters stage split from a current running app. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopMode.java +2 −0 Original line number Diff line number Diff line Loading @@ -51,4 +51,6 @@ public interface DesktopMode { /** Called when requested to go to desktop mode from the current focused app. */ void enterDesktop(int displayId); /** Called when requested to go to fullscreen from the current focused desktop app. */ void moveFocusedTaskToFullscreen(int displayId); }
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +18 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,18 @@ class DesktopTasksController( } } /** Enter fullscreen by moving the focused freeform task in given `displayId` to fullscreen. */ fun enterFullscreen(displayId: Int) { if (DesktopModeStatus.isEnabled()) { shellTaskOrganizer .getRunningTasks(displayId) .find { taskInfo -> taskInfo.isFocused && taskInfo.windowingMode == WINDOWING_MODE_FREEFORM } ?.let { moveToFullscreenWithAnimation(it, it.positionInParent) } } } /** Move a desktop app to split screen. */ fun moveToSplit(task: RunningTaskInfo) { KtProtoLog.v( Loading Loading @@ -1108,6 +1120,12 @@ class DesktopTasksController( this@DesktopTasksController.enterDesktop(displayId) } } override fun moveFocusedTaskToFullscreen(displayId: Int) { mainExecutor.execute { this@DesktopTasksController.enterFullscreen(displayId) } } } /** The interface for calls from outside the host process. */ Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +3 −1 Original line number Diff line number Diff line Loading @@ -476,8 +476,10 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } public void goToFullscreenFromSplit() { if (mStageCoordinator.isSplitActive()) { mStageCoordinator.goToFullscreenFromSplit(); } } /** Move the specified task to fullscreen, regardless of focus state. */ public void moveTaskToFullscreen(int taskId, int exitReason) { Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -781,6 +781,23 @@ class DesktopTasksControllerTest : ShellTestCase() { ) } @Test fun moveFocusedTaskToFullscreen() { val task1 = setUpFreeformTask() val task2 = setUpFreeformTask() val task3 = setUpFreeformTask() task1.isFocused = false task2.isFocused = true task3.isFocused = false controller.enterFullscreen(DEFAULT_DISPLAY) val wct = getLatestExitDesktopWct() assertThat(wct.changes[task2.token.asBinder()]?.windowingMode) .isEqualTo(WINDOWING_MODE_FULLSCREEN) } private fun setUpFreeformTask(displayId: Int = DEFAULT_DISPLAY): RunningTaskInfo { val task = createFreeformTask(displayId) whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task) Loading