Loading libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class DragAndDropPolicy { * Exits splitscreen, with an associated exit trigger from the SplitscreenUIChanged proto * for logging. */ void exitSplitScreen(int exitTrigger); void exitSplitScreen(int toTopTaskId, int exitTrigger); } /** Loading Loading @@ -357,7 +357,7 @@ public class DragAndDropPolicy { } @Override public void exitSplitScreen(int exitTrigger) { public void exitSplitScreen(int toTopTaskId, int exitTrigger) { throw new UnsupportedOperationException("exitSplitScreen not implemented by starter"); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -52,9 +52,10 @@ interface ISplitScreen { oneway void removeFromSideStage(int taskId) = 4; /** * Removes the split-screen stages. * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID * to indicate leaving no top task after leaving split-screen. */ oneway void exitSplitScreen() = 5; oneway void exitSplitScreen(int toTopTaskId) = 5; /** * @param exitSplitScreenOnHide if to exit split-screen if both stages are not visible. Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +5 −5 Original line number Diff line number Diff line Loading @@ -173,8 +173,8 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, leftOrTop ? SPLIT_POSITION_TOP_OR_LEFT : SPLIT_POSITION_BOTTOM_OR_RIGHT); } public void exitSplitScreen(int exitReason) { mStageCoordinator.exitSplitScreen(exitReason); public void exitSplitScreen(int toTopTaskId, int exitReason) { mStageCoordinator.exitSplitScreen(toTopTaskId, exitReason); } public void onKeyguardOccludedChanged(boolean occluded) { Loading Loading @@ -499,11 +499,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } @Override public void exitSplitScreen() { public void exitSplitScreen(int toTopTaskId) { executeRemoteCallWithTaskPermission(mController, "exitSplitScreen", (controller) -> { controller.exitSplitScreen( FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); controller.exitSplitScreen(toTopTaskId, FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__UNKNOWN_EXIT); }); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +23 −6 Original line number Diff line number Diff line Loading @@ -472,16 +472,32 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } void exitSplitScreen(int exitReason) { exitSplitScreen(null /* childrenToTop */, exitReason); } void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) { mExitSplitScreenOnHide = exitSplitScreenOnHide; } void exitSplitScreen(int toTopTaskId, int exitReason) { StageTaskListener childrenToTop = null; if (mMainStage.containsTask(toTopTaskId)) { childrenToTop = mMainStage; } else if (mSideStage.containsTask(toTopTaskId)) { childrenToTop = mSideStage; } final WindowContainerTransaction wct = new WindowContainerTransaction(); if (childrenToTop != null) { childrenToTop.reorderChild(toTopTaskId, true /* onTop */, wct); } applyExitSplitScreen(childrenToTop, wct, exitReason); } private void exitSplitScreen(StageTaskListener childrenToTop, int exitReason) { final WindowContainerTransaction wct = new WindowContainerTransaction(); applyExitSplitScreen(childrenToTop, wct, exitReason); } private void applyExitSplitScreen(StageTaskListener childrenToTop, WindowContainerTransaction wct, int exitReason) { mSideStage.removeAllTasks(wct, childrenToTop == mSideStage); mMainStage.deactivate(wct, childrenToTop == mMainStage); mTaskOrganizer.applyTransaction(wct); Loading Loading @@ -627,7 +643,8 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Don't dismiss staged split when both stages are not visible due to sleeping display, // like the cases keyguard showing or screen off. || (!mMainStage.mRootTaskInfo.isSleeping && !mSideStage.mRootTaskInfo.isSleeping)) { exitSplitScreen(SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); exitSplitScreen(null /* childrenToTop */, SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); } } else if (mKeyguardOccluded) { // At least one of the stages is visible while keyguard occluded. Dismiss split because Loading Loading @@ -1249,7 +1266,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, @Override public void onNoLongerSupportMultiWindow() { if (mMainStage.isActive()) { StageCoordinator.this.exitSplitScreen( StageCoordinator.this.exitSplitScreen(null /* childrenToTop */, SPLITSCREEN_UICHANGED__EXIT_REASON__APP_DOES_NOT_SUPPORT_MULTIWINDOW); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +7 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,13 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { wct.setBounds(mRootTaskInfo.token, bounds); } void reorderChild(int taskId, boolean onTop, WindowContainerTransaction wct) { if (!containsTask(taskId)) { return; } wct.reorder(mChildrenTaskInfo.get(taskId).token, onTop /* onTop */); } void setVisibility(boolean visible, WindowContainerTransaction wct) { wct.reorder(mRootTaskInfo.token, visible /* onTop */); } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java +2 −2 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ public class DragAndDropPolicy { * Exits splitscreen, with an associated exit trigger from the SplitscreenUIChanged proto * for logging. */ void exitSplitScreen(int exitTrigger); void exitSplitScreen(int toTopTaskId, int exitTrigger); } /** Loading Loading @@ -357,7 +357,7 @@ public class DragAndDropPolicy { } @Override public void exitSplitScreen(int exitTrigger) { public void exitSplitScreen(int toTopTaskId, int exitTrigger) { throw new UnsupportedOperationException("exitSplitScreen not implemented by starter"); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -52,9 +52,10 @@ interface ISplitScreen { oneway void removeFromSideStage(int taskId) = 4; /** * Removes the split-screen stages. * Removes the split-screen stages and leaving indicated task to top. Passing INVALID_TASK_ID * to indicate leaving no top task after leaving split-screen. */ oneway void exitSplitScreen() = 5; oneway void exitSplitScreen(int toTopTaskId) = 5; /** * @param exitSplitScreenOnHide if to exit split-screen if both stages are not visible. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +5 −5 Original line number Diff line number Diff line Loading @@ -173,8 +173,8 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, leftOrTop ? SPLIT_POSITION_TOP_OR_LEFT : SPLIT_POSITION_BOTTOM_OR_RIGHT); } public void exitSplitScreen(int exitReason) { mStageCoordinator.exitSplitScreen(exitReason); public void exitSplitScreen(int toTopTaskId, int exitReason) { mStageCoordinator.exitSplitScreen(toTopTaskId, exitReason); } public void onKeyguardOccludedChanged(boolean occluded) { Loading Loading @@ -499,11 +499,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } @Override public void exitSplitScreen() { public void exitSplitScreen(int toTopTaskId) { executeRemoteCallWithTaskPermission(mController, "exitSplitScreen", (controller) -> { controller.exitSplitScreen( FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); controller.exitSplitScreen(toTopTaskId, FrameworkStatsLog.SPLITSCREEN_UICHANGED__EXIT_REASON__UNKNOWN_EXIT); }); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +23 −6 Original line number Diff line number Diff line Loading @@ -472,16 +472,32 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, } } void exitSplitScreen(int exitReason) { exitSplitScreen(null /* childrenToTop */, exitReason); } void exitSplitScreenOnHide(boolean exitSplitScreenOnHide) { mExitSplitScreenOnHide = exitSplitScreenOnHide; } void exitSplitScreen(int toTopTaskId, int exitReason) { StageTaskListener childrenToTop = null; if (mMainStage.containsTask(toTopTaskId)) { childrenToTop = mMainStage; } else if (mSideStage.containsTask(toTopTaskId)) { childrenToTop = mSideStage; } final WindowContainerTransaction wct = new WindowContainerTransaction(); if (childrenToTop != null) { childrenToTop.reorderChild(toTopTaskId, true /* onTop */, wct); } applyExitSplitScreen(childrenToTop, wct, exitReason); } private void exitSplitScreen(StageTaskListener childrenToTop, int exitReason) { final WindowContainerTransaction wct = new WindowContainerTransaction(); applyExitSplitScreen(childrenToTop, wct, exitReason); } private void applyExitSplitScreen(StageTaskListener childrenToTop, WindowContainerTransaction wct, int exitReason) { mSideStage.removeAllTasks(wct, childrenToTop == mSideStage); mMainStage.deactivate(wct, childrenToTop == mMainStage); mTaskOrganizer.applyTransaction(wct); Loading Loading @@ -627,7 +643,8 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, // Don't dismiss staged split when both stages are not visible due to sleeping display, // like the cases keyguard showing or screen off. || (!mMainStage.mRootTaskInfo.isSleeping && !mSideStage.mRootTaskInfo.isSleeping)) { exitSplitScreen(SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); exitSplitScreen(null /* childrenToTop */, SPLITSCREEN_UICHANGED__EXIT_REASON__RETURN_HOME); } } else if (mKeyguardOccluded) { // At least one of the stages is visible while keyguard occluded. Dismiss split because Loading Loading @@ -1249,7 +1266,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler, @Override public void onNoLongerSupportMultiWindow() { if (mMainStage.isActive()) { StageCoordinator.this.exitSplitScreen( StageCoordinator.this.exitSplitScreen(null /* childrenToTop */, SPLITSCREEN_UICHANGED__EXIT_REASON__APP_DOES_NOT_SUPPORT_MULTIWINDOW); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +7 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,13 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener { wct.setBounds(mRootTaskInfo.token, bounds); } void reorderChild(int taskId, boolean onTop, WindowContainerTransaction wct) { if (!containsTask(taskId)) { return; } wct.reorder(mChildrenTaskInfo.get(taskId).token, onTop /* onTop */); } void setVisibility(boolean visible, WindowContainerTransaction wct) { wct.reorder(mRootTaskInfo.token, visible /* onTop */); } Loading