diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-12-02 08:33:51 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-12-02 08:33:51 +0000 |
| commit | 46be27b4ebd747653856c81a38e03fc91da50fe6 (patch) | |
| tree | a8491238b3076187b79f9ff4dd3e5d891685b05a /core/java/android | |
| parent | fac43abf9c085111b04bac94d403f1ea0a76aa5b (diff) | |
| parent | 642ead3a058ddb58351af29f41676ee86ad16a03 (diff) | |
Merge "Move adjacent tasks forward together to ensure occluding state" into sc-v2-dev am: 642ead3a05
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16220664
Change-Id: I610b2e7d03bee916ff309afb98d84f3d4a992678
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/window/WindowContainerTransaction.java | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java index bbf813891387..6864ccaa7c8a 100644 --- a/core/java/android/window/WindowContainerTransaction.java +++ b/core/java/android/window/WindowContainerTransaction.java @@ -368,10 +368,12 @@ public final class WindowContainerTransaction implements Parcelable { */ @NonNull public WindowContainerTransaction setAdjacentRoots( - @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2) { + @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2, + boolean moveTogether) { mHierarchyOps.add(HierarchyOp.createForAdjacentRoots( root1.asBinder(), - root2.asBinder())); + root2.asBinder(), + moveTogether)); return this; } @@ -975,6 +977,9 @@ 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; @@ -1033,10 +1038,13 @@ public final class WindowContainerTransaction implements Parcelable { .build(); } - public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2) { + /** Create a hierarchy op for setting adjacent root tasks. */ + public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2, + boolean moveTogether) { return new HierarchyOp.Builder(HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS) .setContainer(root1) .setReparentContainer(root2) + .setMoveAdjacentTogether(moveTogether) .build(); } @@ -1070,6 +1078,7 @@ public final class WindowContainerTransaction implements Parcelable { mReparent = copy.mReparent; mToTop = copy.mToTop; mReparentTopOnly = copy.mReparentTopOnly; + mMoveAdjacentTogether = copy.mMoveAdjacentTogether; mWindowingModes = copy.mWindowingModes; mActivityTypes = copy.mActivityTypes; mLaunchOptions = copy.mLaunchOptions; @@ -1084,6 +1093,7 @@ public final class WindowContainerTransaction implements Parcelable { mReparent = in.readStrongBinder(); mToTop = in.readBoolean(); mReparentTopOnly = in.readBoolean(); + mMoveAdjacentTogether = in.readBoolean(); mWindowingModes = in.createIntArray(); mActivityTypes = in.createIntArray(); mLaunchOptions = in.readBundle(); @@ -1128,6 +1138,10 @@ public final class WindowContainerTransaction implements Parcelable { return mReparentTopOnly; } + public boolean getMoveAdjacentTogether() { + return mMoveAdjacentTogether; + } + public int[] getWindowingModes() { return mWindowingModes; } @@ -1175,7 +1189,8 @@ 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 + "}"; + + " adjacentRoot=" + mReparent + " mMoveAdjacentTogether=" + + mMoveAdjacentTogether + "}"; case HIERARCHY_OP_TYPE_LAUNCH_TASK: return "{LaunchTask: " + mLaunchOptions + "}"; case HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT: @@ -1212,6 +1227,7 @@ public final class WindowContainerTransaction implements Parcelable { dest.writeStrongBinder(mReparent); dest.writeBoolean(mToTop); dest.writeBoolean(mReparentTopOnly); + dest.writeBoolean(mMoveAdjacentTogether); dest.writeIntArray(mWindowingModes); dest.writeIntArray(mActivityTypes); dest.writeBundle(mLaunchOptions); @@ -1251,6 +1267,8 @@ public final class WindowContainerTransaction implements Parcelable { private boolean mReparentTopOnly; + private boolean mMoveAdjacentTogether; + @Nullable private int[] mWindowingModes; @@ -1293,6 +1311,11 @@ 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; @@ -1336,6 +1359,7 @@ public final class WindowContainerTransaction implements Parcelable { : null; hierarchyOp.mToTop = mToTop; hierarchyOp.mReparentTopOnly = mReparentTopOnly; + hierarchyOp.mMoveAdjacentTogether = mMoveAdjacentTogether; hierarchyOp.mLaunchOptions = mLaunchOptions; hierarchyOp.mActivityIntent = mActivityIntent; hierarchyOp.mPendingIntent = mPendingIntent; |
