Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +5 −1 Original line number Diff line number Diff line Loading @@ -436,8 +436,12 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } public void exitSplitScreen(int toTopTaskId, @ExitReason int exitReason) { if (ENABLE_SHELL_TRANSITIONS) { mStageCoordinator.dismissSplitScreen(toTopTaskId, exitReason); } else { mStageCoordinator.exitSplitScreen(toTopTaskId, exitReason); } } @Override public void onKeyguardVisibilityChanged(boolean visible, boolean occluded, Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenShellCommandHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.splitscreen; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_UNKNOWN; import com.android.wm.shell.sysui.ShellCommandHandler; Loading Loading @@ -45,6 +46,8 @@ public class SplitScreenShellCommandHandler implements return runSetSideStagePosition(args, pw); case "switchSplitPosition": return runSwitchSplitPosition(); case "exitSplitScreen": return runExitSplitScreen(args, pw); default: pw.println("Invalid command: " + args[0]); return false; Loading Loading @@ -91,6 +94,17 @@ public class SplitScreenShellCommandHandler implements return true; } private boolean runExitSplitScreen(String[] args, PrintWriter pw) { if (args.length < 2) { // First argument is the action name. pw.println("Error: task id should be provided as arguments"); return false; } final int taskId = Integer.parseInt(args[1]); mController.exitSplitScreen(taskId, EXIT_REASON_UNKNOWN); return true; } @Override public void printShellCommandHelp(PrintWriter pw, String prefix) { pw.println(prefix + "moveToSideStage <taskId> <SideStagePosition>"); Loading @@ -101,5 +115,7 @@ public class SplitScreenShellCommandHandler implements pw.println(prefix + " Sets the position of the side-stage."); pw.println(prefix + "switchSplitPosition"); pw.println(prefix + " Reverses the split."); pw.println(prefix + "exitSplitScreen <taskId>"); pw.println(prefix + " Exits split screen and leaves the provided split task on top."); } } libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +12 −0 Original line number Diff line number Diff line Loading @@ -1451,6 +1451,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mExitSplitScreenOnHide = exitSplitScreenOnHide; } /** Exits split screen with legacy transition */ void exitSplitScreen(int toTopTaskId, @ExitReason int exitReason) { ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "exitSplitScreen: topTaskId=%d reason=%s active=%b", toTopTaskId, exitReasonToString(exitReason), mMainStage.isActive()); Loading @@ -1470,6 +1471,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, applyExitSplitScreen(childrenToTop, wct, exitReason); } /** Exits split screen with legacy transition */ private void exitSplitScreen(@Nullable StageTaskListener childrenToTop, @ExitReason int exitReason) { ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "exitSplitScreen: mainStageToTop=%b reason=%s active=%b", Loading Loading @@ -1547,6 +1549,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } void dismissSplitScreen(int toTopTaskId, @ExitReason int exitReason) { if (!mMainStage.isActive()) return; final int stage = getStageOfTask(toTopTaskId); final WindowContainerTransaction wct = new WindowContainerTransaction(); prepareExitSplitScreen(stage, wct); mSplitTransitions.startDismissTransition(wct, this, stage, exitReason); } /** * Overridden by child classes. */ Loading Loading @@ -1612,6 +1622,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // User has used a keyboard shortcut to go back to fullscreen from split case EXIT_REASON_DESKTOP_MODE: // One of the children enters desktop mode case EXIT_REASON_UNKNOWN: // Unknown reason return true; default: return false; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +5 −1 Original line number Diff line number Diff line Loading @@ -436,8 +436,12 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } public void exitSplitScreen(int toTopTaskId, @ExitReason int exitReason) { if (ENABLE_SHELL_TRANSITIONS) { mStageCoordinator.dismissSplitScreen(toTopTaskId, exitReason); } else { mStageCoordinator.exitSplitScreen(toTopTaskId, exitReason); } } @Override public void onKeyguardVisibilityChanged(boolean visible, boolean occluded, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenShellCommandHandler.java +16 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.wm.shell.splitscreen; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_UNKNOWN; import com.android.wm.shell.sysui.ShellCommandHandler; Loading Loading @@ -45,6 +46,8 @@ public class SplitScreenShellCommandHandler implements return runSetSideStagePosition(args, pw); case "switchSplitPosition": return runSwitchSplitPosition(); case "exitSplitScreen": return runExitSplitScreen(args, pw); default: pw.println("Invalid command: " + args[0]); return false; Loading Loading @@ -91,6 +94,17 @@ public class SplitScreenShellCommandHandler implements return true; } private boolean runExitSplitScreen(String[] args, PrintWriter pw) { if (args.length < 2) { // First argument is the action name. pw.println("Error: task id should be provided as arguments"); return false; } final int taskId = Integer.parseInt(args[1]); mController.exitSplitScreen(taskId, EXIT_REASON_UNKNOWN); return true; } @Override public void printShellCommandHelp(PrintWriter pw, String prefix) { pw.println(prefix + "moveToSideStage <taskId> <SideStagePosition>"); Loading @@ -101,5 +115,7 @@ public class SplitScreenShellCommandHandler implements pw.println(prefix + " Sets the position of the side-stage."); pw.println(prefix + "switchSplitPosition"); pw.println(prefix + " Reverses the split."); pw.println(prefix + "exitSplitScreen <taskId>"); pw.println(prefix + " Exits split screen and leaves the provided split task on top."); } }
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +12 −0 Original line number Diff line number Diff line Loading @@ -1451,6 +1451,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, mExitSplitScreenOnHide = exitSplitScreenOnHide; } /** Exits split screen with legacy transition */ void exitSplitScreen(int toTopTaskId, @ExitReason int exitReason) { ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "exitSplitScreen: topTaskId=%d reason=%s active=%b", toTopTaskId, exitReasonToString(exitReason), mMainStage.isActive()); Loading @@ -1470,6 +1471,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, applyExitSplitScreen(childrenToTop, wct, exitReason); } /** Exits split screen with legacy transition */ private void exitSplitScreen(@Nullable StageTaskListener childrenToTop, @ExitReason int exitReason) { ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "exitSplitScreen: mainStageToTop=%b reason=%s active=%b", Loading Loading @@ -1547,6 +1549,14 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } void dismissSplitScreen(int toTopTaskId, @ExitReason int exitReason) { if (!mMainStage.isActive()) return; final int stage = getStageOfTask(toTopTaskId); final WindowContainerTransaction wct = new WindowContainerTransaction(); prepareExitSplitScreen(stage, wct); mSplitTransitions.startDismissTransition(wct, this, stage, exitReason); } /** * Overridden by child classes. */ Loading Loading @@ -1612,6 +1622,8 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, // User has used a keyboard shortcut to go back to fullscreen from split case EXIT_REASON_DESKTOP_MODE: // One of the children enters desktop mode case EXIT_REASON_UNKNOWN: // Unknown reason return true; default: return false; Loading