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

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

Replace old setAdjacentRoots

All usages of the old version have been updated. It should be ok to
update the TestApi for new SDK finalize.

Fix: 373709676
Test: pass existing tests
Flag: EXEMPT replace TestApi without a new feature
Change-Id: I7944cc939ab85982c4d693b8c0a6679ba5f20508
parent 8441f07f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4579,7 +4579,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 @Deprecated @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@NonNull android.window.WindowContainerToken, @NonNull android.window.WindowContainerToken);
    method @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@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 −21
Original line number Diff line number Diff line
@@ -862,22 +862,6 @@ public final class WindowContainerTransaction implements Parcelable {
     * ===========================================================================================
     */

    /**
     * Sets two containers adjacent to each other. Containers below two visible adjacent roots will
     * be made invisible. This currently only applies to TaskFragment containers created by
     * 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) {
        return setAdjacentRootSet(root1, root2);
    }

    /**
     * Sets multiple containers adjacent to each other. Containers below the visible adjacent roots
     * will be made invisible. This currently only applies to Task containers created by organizer.
@@ -891,12 +875,12 @@ 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 in 25Q4.
     */
    @SuppressWarnings("UnflaggedApi") // @TestApi without associated feature.
    @NonNull
    public WindowContainerTransaction setAdjacentRootSet(@NonNull WindowContainerToken... roots) {
    public WindowContainerTransaction setAdjacentRoots(@NonNull WindowContainerToken... roots) {
        if (roots.length < 2) {
            throw new IllegalArgumentException("setAdjacentRootSet must have size >= 2");
            throw new IllegalArgumentException("setAdjacentRoots must have size >= 2");
        }
        final IBinder[] rootTokens = new IBinder[roots.length];
        for (int i = 0; i < roots.length; i++) {
@@ -911,7 +895,7 @@ public final class WindowContainerTransaction implements Parcelable {

    /**
     * Clears container adjacent.
     * If {@link #setAdjacentRootSet} is called with more than 2 roots, calling this will only
     * If {@link #setAdjacentRoots} is called with more than 2 roots, calling this will only
     * remove the given root from the adjacent set. The rest of roots will stay adjacent to each
     * other.
     *
@@ -1253,7 +1237,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 #setAdjacentRootSet(WindowContainerToken...)}, but can be used with
     * {@link #setAdjacentRoots(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
+1 −1
Original line number Diff line number Diff line
@@ -2540,7 +2540,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
            // TODO: consider support 3 splits

            // Make the stages adjacent to each other so they occlude what's behind them.
            wct.setAdjacentRootSet(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
            wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
            mSplitLayout.getInvisibleBounds(mTempRect1);
            wct.setBounds(mSideStage.mRootTaskInfo.token, mTempRect1);
        }
+2 −2
Original line number Diff line number Diff line
@@ -957,7 +957,7 @@ public class WindowOrganizerTests extends WindowTestsBase {
        final RunningTaskInfo info2 = task2.getTaskInfo();

        WindowContainerTransaction wct = new WindowContainerTransaction();
        wct.setAdjacentRootSet(info1.token, info2.token);
        wct.setAdjacentRoots(info1.token, info2.token);
        mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct);
        assertTrue(task1.isAdjacentTo(task2));
        assertTrue(task2.isAdjacentTo(task1));
@@ -991,7 +991,7 @@ public class WindowOrganizerTests extends WindowTestsBase {
        final RunningTaskInfo info3 = task3.getTaskInfo();

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