Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc188a82 authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Splitscreen#launchIntent: Allow usage with non-fullscreen displays." into main

parents c6c40848 77184dbc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -641,8 +641,8 @@ public final class WindowContainerTransaction implements Parcelable {

    /**
     * Reparent's all children tasks or the top task of {@param currentParent} in the specified
     * {@param windowingMode} and {@param activityType} to {@param newParent} in their current
     * z-order.
     * overridden {@param windowingMode} and {@param activityType} to {@param newParent} in their
     * current z-order.
     *
     * @param currentParent of the tasks to perform the operation no.
     *                      {@code null} will perform the operation on the display.
+10 −0
Original line number Diff line number Diff line
@@ -40,6 +40,16 @@ flag {
    bug: "325240072"
}

flag {
    name: "disable_restore_non_fullscreen_bounds_on_configuration_change"
    namespace: "lse_desktop_experience"
    description: "Disable restoring bounds to mLastNonFullscreenBounds on configuration change."
    bug: "372315420"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "empty_roots_never_top"
    namespace: "lse_desktop_experience"
+4 −0
Original line number Diff line number Diff line
@@ -3082,6 +3082,9 @@ class DesktopTasksController(
        val options = createNewWindowOptions(callingTaskInfo, deskId)
        when (options.launchWindowingMode) {
            WINDOWING_MODE_MULTI_WINDOW -> {
                val wct = WindowContainerTransaction()
                wct.setWindowingMode(callingTaskInfo.token, WINDOWING_MODE_UNDEFINED)
                    .setBounds(callingTaskInfo.token, Rect())
                val splitPosition =
                    splitScreenController.determineNewInstancePosition(callingTaskInfo)
                // TODO(b/349828130) currently pass in index_undefined until we can revisit these
@@ -3097,6 +3100,7 @@ class DesktopTasksController(
                    splitPosition,
                    options.toBundle(),
                    /* hideTaskToken= */ null,
                    wct,
                    /* forceLaunchNewTask= */ true,
                    splitIndex,
                    if (ENABLE_NON_DEFAULT_DISPLAY_SPLIT.isTrue) callingTaskInfo.displayId
+4 −4
Original line number Diff line number Diff line
@@ -868,7 +868,7 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
    public void startIntent(PendingIntent intent, int userId1, @Nullable Intent fillInIntent,
            @SplitPosition int position, @Nullable Bundle options,
            @Nullable WindowContainerToken hideTaskToken, @SplitIndex int index) {
        startIntent(intent, userId1, fillInIntent, position, options, hideTaskToken,
        startIntent(intent, userId1, fillInIntent, position, options, hideTaskToken, null /* wct */,
                false /* forceLaunchNewTask */, index, DEFAULT_DISPLAY);
    }

@@ -882,8 +882,8 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
     */
    public void startIntent(PendingIntent intent, int userId1, @Nullable Intent fillInIntent,
            @SplitPosition int position, @Nullable Bundle options,
            @Nullable WindowContainerToken hideTaskToken, boolean forceLaunchNewTask,
            @SplitIndex int index, int displayId) {
            @Nullable WindowContainerToken hideTaskToken, @Nullable WindowContainerTransaction wct,
            boolean forceLaunchNewTask, @SplitIndex int index, int displayId) {
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN,
                "startIntent(): intent=%s user=%d fillInIntent=%s position=%d", intent, userId1,
                fillInIntent, position);
@@ -935,7 +935,7 @@ public class SplitScreenController implements SplitDragPolicy.Starter,
        }

        mStageCoordinator.startIntent(intent, fillInIntent, position, options, hideTaskToken,
                index, displayId);
                wct, index, displayId);
    }

    /**
+5 −1
Original line number Diff line number Diff line
@@ -848,12 +848,16 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
     */
    void startIntent(PendingIntent intent, Intent fillInIntent, @SplitPosition int position,
            @Nullable Bundle options, @Nullable WindowContainerToken hideTaskToken,
            @SplitIndex int index, int displayId) {
            @Nullable WindowContainerTransaction transaction, @SplitIndex int index,
            int displayId) {
        ProtoLog.d(WM_SHELL_SPLIT_SCREEN, "startIntent: intent=%s position=%d", intent.getIntent(),
                position);
        mSplitRequest = new SplitRequest(intent.getIntent(), position);

        final WindowContainerTransaction wct = new WindowContainerTransaction();
        if (transaction != null) {
            wct.merge(transaction, true);
        }
        options = enableFlexibleSplit()
                ? resolveStartStageForIndex(options, null /*wct*/, index)
                : resolveStartStage(STAGE_TYPE_UNDEFINED, position, options, null /* wct */);
Loading