Loading core/java/android/window/WindowContainerTransaction.java +4 −2 Original line number Diff line number Diff line Loading @@ -348,8 +348,10 @@ public final class WindowContainerTransaction implements Parcelable { * @param currentParent of the tasks to perform the operation no. * {@code null} will perform the operation on the display. * @param newParent for the tasks. {@code null} will perform the operation on the display. * @param windowingModes of the tasks to reparent. * @param activityTypes of the tasks to reparent. * @param windowingModes of the tasks to reparent. {@code null} ignore this attribute when * perform the operation. * @param activityTypes of the tasks to reparent. {@code null} ignore this attribute when * perform the operation. * @param onTop When {@code true}, the child goes to the top of parent; otherwise it goes to * the bottom. */ Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,11 @@ */ package com.android.wm.shell.common.split; import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import android.annotation.IntDef; /** Helper utility class of methods and constants that are available to be imported in Launcher. */ Loading Loading @@ -44,4 +49,10 @@ public class SplitScreenConstants { }) public @interface SplitPosition { } public static final int[] CONTROLLED_ACTIVITY_TYPES = {ACTIVITY_TYPE_STANDARD}; public static final int[] CONTROLLED_WINDOWING_MODES = {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED}; public static final int[] CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE = {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED, WINDOWING_MODE_MULTI_WINDOW}; } libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/MainStage.java +8 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.wm.shell.splitscreen; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_ACTIVITY_TYPES; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_WINDOWING_MODES; import android.content.Context; import android.view.SurfaceSession; import android.window.WindowContainerToken; Loading Loading @@ -76,8 +79,8 @@ class MainStage extends StageTaskListener { wct.reparentTasks( rootToken, null /* newParent */, CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE, CONTROLLED_ACTIVITY_TYPES, null /* windowingModes */, null /* activityTypes */, toTop); } } libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ class SideStage extends StageTaskListener { wct.reparentTasks( mRootTaskInfo.token, null /* newParent */, CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE, CONTROLLED_ACTIVITY_TYPES, null /* windowingModes */, null /* activityTypes */, toTop); return true; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +10 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.view.RemoteAnimationTarget.MODE_OPENING; import static com.android.wm.shell.common.ExecutorUtils.executeRemoteCallWithTaskPermission; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_ACTIVITY_TYPES; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_WINDOWING_MODES; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED; Loading Loading @@ -64,6 +66,7 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.InstanceId; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.ArrayUtils; import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.RootTaskDisplayAreaOrganizer; import com.android.wm.shell.ShellTaskOrganizer; Loading Loading @@ -227,6 +230,12 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, && mStageCoordinator.getStageOfTask(taskId) != STAGE_TYPE_UNDEFINED; } public boolean isValidToEnterSplitScreen(@NonNull ActivityManager.RunningTaskInfo taskInfo) { return taskInfo.supportsMultiWindow && ArrayUtils.contains(CONTROLLED_ACTIVITY_TYPES, taskInfo.getActivityType()) && ArrayUtils.contains(CONTROLLED_WINDOWING_MODES, taskInfo.getWindowingMode()); } public @SplitPosition int getSplitPosition(int taskId) { return mStageCoordinator.getSplitPosition(taskId); } Loading Loading @@ -463,11 +472,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, return Objects.equals(launchingActivity, pairedActivity); } if (mFocusingTaskInfo != null // TODO (b/238032411): have an API to determine whether an activity is valid for // split screen or not. && mFocusingTaskInfo.getWindowingMode() == WINDOWING_MODE_FULLSCREEN && mFocusingTaskInfo.getActivityType() == ACTIVITY_TYPE_STANDARD) { if (mFocusingTaskInfo != null && isValidToEnterSplitScreen(mFocusingTaskInfo)) { return Objects.equals(mFocusingTaskInfo.baseIntent.getComponent(), launchingActivity); } Loading Loading
core/java/android/window/WindowContainerTransaction.java +4 −2 Original line number Diff line number Diff line Loading @@ -348,8 +348,10 @@ public final class WindowContainerTransaction implements Parcelable { * @param currentParent of the tasks to perform the operation no. * {@code null} will perform the operation on the display. * @param newParent for the tasks. {@code null} will perform the operation on the display. * @param windowingModes of the tasks to reparent. * @param activityTypes of the tasks to reparent. * @param windowingModes of the tasks to reparent. {@code null} ignore this attribute when * perform the operation. * @param activityTypes of the tasks to reparent. {@code null} ignore this attribute when * perform the operation. * @param onTop When {@code true}, the child goes to the top of parent; otherwise it goes to * the bottom. */ Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,11 @@ */ package com.android.wm.shell.common.split; import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import android.annotation.IntDef; /** Helper utility class of methods and constants that are available to be imported in Launcher. */ Loading Loading @@ -44,4 +49,10 @@ public class SplitScreenConstants { }) public @interface SplitPosition { } public static final int[] CONTROLLED_ACTIVITY_TYPES = {ACTIVITY_TYPE_STANDARD}; public static final int[] CONTROLLED_WINDOWING_MODES = {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED}; public static final int[] CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE = {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED, WINDOWING_MODE_MULTI_WINDOW}; }
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/MainStage.java +8 −5 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package com.android.wm.shell.splitscreen; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_ACTIVITY_TYPES; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_WINDOWING_MODES; import android.content.Context; import android.view.SurfaceSession; import android.window.WindowContainerToken; Loading Loading @@ -76,8 +79,8 @@ class MainStage extends StageTaskListener { wct.reparentTasks( rootToken, null /* newParent */, CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE, CONTROLLED_ACTIVITY_TYPES, null /* windowingModes */, null /* activityTypes */, toTop); } }
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SideStage.java +2 −2 Original line number Diff line number Diff line Loading @@ -47,8 +47,8 @@ class SideStage extends StageTaskListener { wct.reparentTasks( mRootTaskInfo.token, null /* newParent */, CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE, CONTROLLED_ACTIVITY_TYPES, null /* windowingModes */, null /* activityTypes */, toTop); return true; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java +10 −5 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import static android.view.Display.DEFAULT_DISPLAY; import static android.view.RemoteAnimationTarget.MODE_OPENING; import static com.android.wm.shell.common.ExecutorUtils.executeRemoteCallWithTaskPermission; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_ACTIVITY_TYPES; import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_WINDOWING_MODES; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT; import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED; Loading Loading @@ -64,6 +66,7 @@ import androidx.annotation.Nullable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.InstanceId; import com.android.internal.protolog.common.ProtoLog; import com.android.internal.util.ArrayUtils; import com.android.launcher3.icons.IconProvider; import com.android.wm.shell.RootTaskDisplayAreaOrganizer; import com.android.wm.shell.ShellTaskOrganizer; Loading Loading @@ -227,6 +230,12 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, && mStageCoordinator.getStageOfTask(taskId) != STAGE_TYPE_UNDEFINED; } public boolean isValidToEnterSplitScreen(@NonNull ActivityManager.RunningTaskInfo taskInfo) { return taskInfo.supportsMultiWindow && ArrayUtils.contains(CONTROLLED_ACTIVITY_TYPES, taskInfo.getActivityType()) && ArrayUtils.contains(CONTROLLED_WINDOWING_MODES, taskInfo.getWindowingMode()); } public @SplitPosition int getSplitPosition(int taskId) { return mStageCoordinator.getSplitPosition(taskId); } Loading Loading @@ -463,11 +472,7 @@ public class SplitScreenController implements DragAndDropPolicy.Starter, return Objects.equals(launchingActivity, pairedActivity); } if (mFocusingTaskInfo != null // TODO (b/238032411): have an API to determine whether an activity is valid for // split screen or not. && mFocusingTaskInfo.getWindowingMode() == WINDOWING_MODE_FULLSCREEN && mFocusingTaskInfo.getActivityType() == ACTIVITY_TYPE_STANDARD) { if (mFocusingTaskInfo != null && isValidToEnterSplitScreen(mFocusingTaskInfo)) { return Objects.equals(mFocusingTaskInfo.baseIntent.getComponent(), launchingActivity); } Loading