diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl index f819bee2d5e09..81e118a31b73f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/ISplitScreen.aidl @@ -129,10 +129,9 @@ interface ISplitScreen { /** * Start a pair of intents in one transition. */ - oneway void startIntents(in PendingIntent pendingIntent1, in ShortcutInfo shortcutInfo1, - in Bundle options1, in PendingIntent pendingIntent2, in ShortcutInfo shortcutInfo2, - in Bundle options2, int splitPosition, float splitRatio, - in RemoteTransition remoteTransition, in InstanceId instanceId) = 19; + oneway void startIntents(in PendingIntent pendingIntent1, in Bundle options1, + in PendingIntent pendingIntent2, in Bundle options2, int splitPosition, + float splitRatio, in RemoteTransition remoteTransition, in InstanceId instanceId) = 19; /** * Blocking call that notifies and gets additional split-screen targets when entering diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java index 2cd16be9590cb..7d5ab8428a3e7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java @@ -626,35 +626,6 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, splitPosition, splitRatio, adapter, instanceId); } - private void startIntents(PendingIntent pendingIntent1, - @Nullable ShortcutInfo shortcutInfo1, @Nullable Bundle options1, - PendingIntent pendingIntent2, @Nullable ShortcutInfo shortcutInfo2, - @Nullable Bundle options2, @SplitPosition int splitPosition, float splitRatio, - @Nullable RemoteTransition remoteTransition, InstanceId instanceId) { - Intent fillInIntent1 = null; - Intent fillInIntent2 = null; - final String packageName1 = SplitScreenUtils.getPackageName(pendingIntent1); - final String packageName2 = SplitScreenUtils.getPackageName(pendingIntent2); - if (samePackage(packageName1, packageName2)) { - if (supportMultiInstancesSplit(packageName1)) { - fillInIntent1 = new Intent(); - fillInIntent1.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK); - fillInIntent2 = new Intent(); - fillInIntent2.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK); - ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, "Adding MULTIPLE_TASK"); - } else { - pendingIntent2 = null; - ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN, - "Cancel entering split as not supporting multi-instances"); - Toast.makeText(mContext, R.string.dock_multi_instances_not_supported_text, - Toast.LENGTH_SHORT).show(); - } - } - mStageCoordinator.startIntents(pendingIntent1, fillInIntent1, shortcutInfo1, options1, - pendingIntent2, fillInIntent2, shortcutInfo2, options2, splitPosition, splitRatio, - remoteTransition, instanceId); - } - @Override public void startIntent(PendingIntent intent, @Nullable Intent fillInIntent, @SplitPosition int position, @Nullable Bundle options) { @@ -1095,17 +1066,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, } @Override - public void startIntents(PendingIntent pendingIntent1, @Nullable ShortcutInfo shortcutInfo1, - @Nullable Bundle options1, PendingIntent pendingIntent2, - @Nullable ShortcutInfo shortcutInfo2, @Nullable Bundle options2, + public void startIntents(PendingIntent pendingIntent1, @Nullable Bundle options1, + PendingIntent pendingIntent2, @Nullable Bundle options2, @SplitPosition int splitPosition, float splitRatio, @Nullable RemoteTransition remoteTransition, InstanceId instanceId) { - executeRemoteCallWithTaskPermission(mController, "startIntents", - (controller) -> - controller.startIntents(pendingIntent1, shortcutInfo1, - options1, pendingIntent2, shortcutInfo2, options2, - splitPosition, splitRatio, remoteTransition, instanceId) - ); + // TODO(b/259368992): To be implemented. } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index f00fdba507481..dd91a37039e42 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -682,46 +682,6 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, setEnterInstanceId(instanceId); } - void startIntents(PendingIntent pendingIntent1, Intent fillInIntent1, - @Nullable ShortcutInfo shortcutInfo1, @Nullable Bundle options1, - PendingIntent pendingIntent2, Intent fillInIntent2, - @Nullable ShortcutInfo shortcutInfo2, @Nullable Bundle options2, - @SplitPosition int splitPosition, float splitRatio, - @Nullable RemoteTransition remoteTransition, InstanceId instanceId) { - final WindowContainerTransaction wct = new WindowContainerTransaction(); - if (!mMainStage.isActive()) { - // Build a request WCT that will launch both apps such that task 0 is on the main stage - // while task 1 is on the side stage. - mMainStage.activate(wct, false /* reparent */); - } - - prepareEvictChildTasksIfSplitActive(wct); - mSplitLayout.setDivideRatio(splitRatio); - updateWindowBounds(mSplitLayout, wct); - wct.reorder(mRootTaskInfo.token, true); - setRootForceTranslucent(false, wct); - - setSideStagePosition(splitPosition, wct); - options1 = options1 != null ? options1 : new Bundle(); - addActivityOptions(options1, mSideStage); - if (shortcutInfo1 != null) { - wct.startShortcut(mContext.getPackageName(), shortcutInfo1, options1); - } else { - wct.sendPendingIntent(pendingIntent1, fillInIntent1, options1); - } - options2 = options2 != null ? options2 : new Bundle(); - addActivityOptions(options2, mMainStage); - if (shortcutInfo2 != null) { - wct.startShortcut(mContext.getPackageName(), shortcutInfo2, options2); - } else { - wct.sendPendingIntent(pendingIntent2, fillInIntent2, options2); - } - - mSplitTransitions.startEnterTransition( - TRANSIT_SPLIT_SCREEN_PAIR_OPEN, wct, remoteTransition, this, null, null); - setEnterInstanceId(instanceId); - } - /** Starts a pair of tasks using legacy transition. */ void startTasksWithLegacyTransition(int taskId1, @Nullable Bundle options1, int taskId2, @Nullable Bundle options2, @SplitPosition int splitPosition,