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

Commit 20e50390 authored by Tony Huang's avatar Tony Huang
Browse files

Remove the special logic of the divider bar z-ordering

Remove the divider bar z-ordering logic since the divider bar is
attached to a single-top root task for split screen now. Remove
split anchor too because it is for legacy split screen using.
Also removed corresponding tests which are no longer needed after
this patch.

Bug: 199236198
Test: pass existing tests
Change-Id: I3435a3c81de78804c8110eb38bbacd0a23b391ef
parent c112b332
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3393,7 +3393,7 @@ package android.window {
    method @NonNull public android.window.WindowContainerTransaction reparentTasks(@Nullable android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, @Nullable int[], @Nullable int[], boolean);
    method @NonNull public android.window.WindowContainerTransaction scheduleFinishEnterPip(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
    method @NonNull public android.window.WindowContainerTransaction setActivityWindowingMode(@NonNull android.window.WindowContainerToken, int);
    method @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@NonNull android.window.WindowContainerToken, @NonNull android.window.WindowContainerToken, boolean);
    method @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@NonNull android.window.WindowContainerToken, @NonNull android.window.WindowContainerToken);
    method @NonNull public android.window.WindowContainerTransaction setAdjacentTaskFragments(@NonNull android.os.IBinder, @Nullable android.os.IBinder, @Nullable android.window.WindowContainerTransaction.TaskFragmentAdjacentParams);
    method @NonNull public android.window.WindowContainerTransaction setAppBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
    method @NonNull public android.window.WindowContainerTransaction setBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect);
+0 −4
Original line number Diff line number Diff line
@@ -237,10 +237,6 @@ public interface WindowManagerPolicyConstants {
     */
    int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER - 1;

    // TODO(b/207185041): Remove this divider workaround after we full remove leagacy split and
    //                    make app pair split only have single root then we can just attach the
    //                    divider to the single root task in shell.
    int SPLIT_DIVIDER_LAYER = TYPE_LAYER_MULTIPLIER * 3;
    int WATERMARK_LAYER = TYPE_LAYER_MULTIPLIER * 100;
    int STRICT_MODE_LAYER = TYPE_LAYER_MULTIPLIER * 101;
    int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200;
+4 −27
Original line number Diff line number Diff line
@@ -384,12 +384,10 @@ public final class WindowContainerTransaction implements Parcelable {
     */
    @NonNull
    public WindowContainerTransaction setAdjacentRoots(
            @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2,
            boolean moveTogether) {
            @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2) {
        mHierarchyOps.add(HierarchyOp.createForAdjacentRoots(
                root1.asBinder(),
                root2.asBinder(),
                moveTogether));
                root2.asBinder()));
        return this;
    }

@@ -1106,9 +1104,6 @@ public final class WindowContainerTransaction implements Parcelable {

        private boolean mReparentTopOnly;

        // TODO(b/207185041): Remove this once having a single-top root for split screen.
        private boolean mMoveAdjacentTogether;

        @Nullable
        private int[]  mWindowingModes;

@@ -1171,12 +1166,10 @@ public final class WindowContainerTransaction implements Parcelable {
        }

        /** Create a hierarchy op for setting adjacent root tasks. */
        public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2,
                boolean moveTogether) {
        public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2) {
            return new HierarchyOp.Builder(HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS)
                    .setContainer(root1)
                    .setReparentContainer(root2)
                    .setMoveAdjacentTogether(moveTogether)
                    .build();
        }

@@ -1223,7 +1216,6 @@ public final class WindowContainerTransaction implements Parcelable {
            mInsetsProviderFrame = copy.mInsetsProviderFrame;
            mToTop = copy.mToTop;
            mReparentTopOnly = copy.mReparentTopOnly;
            mMoveAdjacentTogether = copy.mMoveAdjacentTogether;
            mWindowingModes = copy.mWindowingModes;
            mActivityTypes = copy.mActivityTypes;
            mLaunchOptions = copy.mLaunchOptions;
@@ -1245,7 +1237,6 @@ public final class WindowContainerTransaction implements Parcelable {
            }
            mToTop = in.readBoolean();
            mReparentTopOnly = in.readBoolean();
            mMoveAdjacentTogether = in.readBoolean();
            mWindowingModes = in.createIntArray();
            mActivityTypes = in.createIntArray();
            mLaunchOptions = in.readBundle();
@@ -1300,10 +1291,6 @@ public final class WindowContainerTransaction implements Parcelable {
            return mReparentTopOnly;
        }

        public boolean getMoveAdjacentTogether() {
            return mMoveAdjacentTogether;
        }

        public int[] getWindowingModes() {
            return mWindowingModes;
        }
@@ -1356,8 +1343,7 @@ public final class WindowContainerTransaction implements Parcelable {
                    return "{reorder: " + mContainer + " to " + (mToTop ? "top" : "bottom") + "}";
                case HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS:
                    return "{SetAdjacentRoot: container=" + mContainer
                            + " adjacentRoot=" + mReparent + " mMoveAdjacentTogether="
                            + mMoveAdjacentTogether + "}";
                            + " adjacentRoot=" + mReparent + "}";
                case HIERARCHY_OP_TYPE_LAUNCH_TASK:
                    return "{LaunchTask: " + mLaunchOptions + "}";
                case HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT:
@@ -1413,7 +1399,6 @@ public final class WindowContainerTransaction implements Parcelable {
            }
            dest.writeBoolean(mToTop);
            dest.writeBoolean(mReparentTopOnly);
            dest.writeBoolean(mMoveAdjacentTogether);
            dest.writeIntArray(mWindowingModes);
            dest.writeIntArray(mActivityTypes);
            dest.writeBundle(mLaunchOptions);
@@ -1458,8 +1443,6 @@ public final class WindowContainerTransaction implements Parcelable {

            private boolean mReparentTopOnly;

            private boolean mMoveAdjacentTogether;

            @Nullable
            private int[]  mWindowingModes;

@@ -1515,11 +1498,6 @@ public final class WindowContainerTransaction implements Parcelable {
                return this;
            }

            Builder setMoveAdjacentTogether(boolean moveAdjacentTogether) {
                mMoveAdjacentTogether = moveAdjacentTogether;
                return this;
            }

            Builder setWindowingModes(@Nullable int[] windowingModes) {
                mWindowingModes = windowingModes;
                return this;
@@ -1570,7 +1548,6 @@ public final class WindowContainerTransaction implements Parcelable {
                hierarchyOp.mInsetsProviderFrame = mInsetsProviderFrame;
                hierarchyOp.mToTop = mToTop;
                hierarchyOp.mReparentTopOnly = mReparentTopOnly;
                hierarchyOp.mMoveAdjacentTogether = mMoveAdjacentTogether;
                hierarchyOp.mLaunchOptions = mLaunchOptions;
                hierarchyOp.mActivityIntent = mActivityIntent;
                hierarchyOp.mPendingIntent = mPendingIntent;
+1 −2
Original line number Diff line number Diff line
@@ -1025,8 +1025,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        wct.reparent(mMainStage.mRootTaskInfo.token, mRootTaskInfo.token, true);
        wct.reparent(mSideStage.mRootTaskInfo.token, mRootTaskInfo.token, true);
        // Make the stages adjacent to each other so they occlude what's behind them.
        wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token,
                true /* moveTogether */);
        wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
        wct.setLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
        mTaskOrganizer.applyTransaction(wct);
    }
+1 −11
Original line number Diff line number Diff line
@@ -4567,22 +4567,12 @@ class Task extends TaskFragment {
        moveToFront(reason, null);
    }

    void moveToFront(String reason, Task task) {
        if (mMoveAdjacentTogether && getAdjacentTaskFragment() != null) {
            final Task adjacentTask = getAdjacentTaskFragment().asTask();
            if (adjacentTask != null) {
                adjacentTask.moveToFrontInner(reason + " adjacentTaskToTop", null /* task */);
            }
        }
        moveToFrontInner(reason, task);
    }

    /**
     * @param reason The reason for moving the root task to the front.
     * @param task If non-null, the task will be moved to the top of the root task.
     */
    @VisibleForTesting
    void moveToFrontInner(String reason, Task task) {
    void moveToFront(String reason, Task task) {
        if (!isAttached()) {
            return;
        }
Loading