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

Commit 53130082 authored by Chris Li's avatar Chris Li
Browse files

Replace usage of WCT.setAdjacentRoots

Bug: 373709676
Test: Flag cleanup
Flag: EXEMPT cleanup
Change-Id: Ibae42d8dfe999bc3bdaafc743889903a6b766705
parent c2dd5e1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4506,7 +4506,7 @@ package android.window {
    method @NonNull public android.window.WindowContainerTransaction requestFocusOnTaskFragment(@NonNull android.os.IBinder);
    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);
    method @Deprecated @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, @NonNull 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);
+5 −2
Original line number Diff line number Diff line
@@ -684,7 +684,10 @@ public final class WindowContainerTransaction implements Parcelable {
     * organizer.
     * @param root1 the first root.
     * @param root2 the second root.
     * @deprecated replace with {@link #setAdjacentRootSet}
     */
    @SuppressWarnings("UnflaggedApi") // @TestApi without associated feature.
    @Deprecated
    @NonNull
    public WindowContainerTransaction setAdjacentRoots(
            @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2) {
@@ -704,7 +707,7 @@ public final class WindowContainerTransaction implements Parcelable {
     *
     * @param roots the Tasks that should be adjacent to each other.
     * @throws IllegalArgumentException if roots have size < 2.
     * @hide // TODO(b/373709676) Rename to setAdjacentRoots and update CTS.
     * @hide // TODO(b/373709676) Rename to setAdjacentRoots and update CTS in 25Q4.
     */
    @NonNull
    public WindowContainerTransaction setAdjacentRootSet(@NonNull WindowContainerToken... roots) {
@@ -1003,7 +1006,7 @@ public final class WindowContainerTransaction implements Parcelable {
    /**
     * Sets to TaskFragments adjacent to each other. Containers below two visible adjacent
     * TaskFragments will be made invisible. This is similar to
     * {@link #setAdjacentRoots(WindowContainerToken, WindowContainerToken)}, but can be used with
     * {@link #setAdjacentRootSet(WindowContainerToken...)}, but can be used with
     * fragmentTokens when that TaskFragments haven't been created (but will be created in the same
     * {@link WindowContainerTransaction}).
     * @param fragmentToken1    client assigned unique token to create TaskFragment with specified
+3 −4
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ import android.app.ActivityManager;
import android.app.ActivityOptions;
import android.app.IActivityTaskManager;
import android.app.PendingIntent;
import android.app.PictureInPictureParams;
import android.app.TaskInfo;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -2249,10 +2248,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,

        setRootForceTranslucent(true, wct);
        if (!enableFlexibleSplit()) {
            //TODO(b/373709676) Need to figure out how adjacentRoots work for flex split
            // TODO: consider support 3 splits

            // Make the stages adjacent to each other so they occlude what's behind them.
            wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
            wct.setAdjacentRootSet(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
            mSplitLayout.getInvisibleBounds(mTempRect1);
            wct.setBounds(mSideStage.mRootTaskInfo.token, mTempRect1);
        }
@@ -2263,7 +2262,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            });
            mLaunchAdjacentController.setLaunchAdjacentRoot(mSideStage.mRootTaskInfo.token);
        } else {
            // TODO(b/373709676) Need to figure out how adjacentRoots work for flex split
            // TODO: consider support 3 splits
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -910,7 +910,7 @@ public class WindowOrganizerTests extends WindowTestsBase {
        final RunningTaskInfo info2 = task2.getTaskInfo();

        WindowContainerTransaction wct = new WindowContainerTransaction();
        wct.setAdjacentRoots(info1.token, info2.token);
        wct.setAdjacentRootSet(info1.token, info2.token);
        mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct);
        assertTrue(task1.isAdjacentTo(task2));
        assertTrue(task2.isAdjacentTo(task1));