Loading core/java/android/window/WindowContainerTransaction.java +6 −55 Original line number Diff line number Diff line Loading @@ -203,36 +203,6 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Like {@link #setBoundsChangeTransaction} but instead queues up a setPosition/WindowCrop * on a container's surface control. This is useful when a boundsChangeTransaction needs to be * queued up on a Task that won't be organized until the end of this window-container * transaction. * * This requires that, at the end of this transaction, `task` will be organized; otherwise * the server will throw an IllegalArgumentException. * * WARNING: Use this carefully. Whatever is set here should match the expected bounds after * the transaction completes since it will likely be replaced by it. This call is * intended to pre-emptively set bounds on a surface in sync with a buffer when * otherwise the new bounds and the new buffer would update on different frames. * * TODO(b/134365562): remove once TaskOrg drives full-screen or BLAST is enabled. * * @hide */ @NonNull public WindowContainerTransaction setBoundsChangeTransaction( @NonNull WindowContainerToken task, @NonNull Rect surfaceBounds) { Change chg = getOrCreateChange(task.asBinder()); if (chg.mBoundsChangeSurfaceBounds == null) { chg.mBoundsChangeSurfaceBounds = new Rect(); } chg.mBoundsChangeSurfaceBounds.set(surfaceBounds); chg.mChangeMask |= Change.CHANGE_BOUNDS_TRANSACTION_RECT; return this; } /** * Set the windowing mode of children of a given root task, without changing * the windowing mode of the Task itself. This can be used during transitions Loading Loading @@ -1206,7 +1176,7 @@ public final class WindowContainerTransaction implements Parcelable { @NonNull public static final Creator<WindowContainerTransaction> CREATOR = new Creator<WindowContainerTransaction>() { new Creator<>() { @Override public WindowContainerTransaction createFromParcel(@NonNull Parcel in) { return new WindowContainerTransaction(in); Loading @@ -1227,19 +1197,17 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_BOUNDS_TRANSACTION = 1 << 1; public static final int CHANGE_PIP_CALLBACK = 1 << 2; public static final int CHANGE_HIDDEN = 1 << 3; public static final int CHANGE_BOUNDS_TRANSACTION_RECT = 1 << 4; public static final int CHANGE_IGNORE_ORIENTATION_REQUEST = 1 << 5; public static final int CHANGE_FORCE_NO_PIP = 1 << 6; public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 7; public static final int CHANGE_DRAG_RESIZING = 1 << 8; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 9; public static final int CHANGE_IGNORE_ORIENTATION_REQUEST = 1 << 4; public static final int CHANGE_FORCE_NO_PIP = 1 << 5; public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 6; public static final int CHANGE_DRAG_RESIZING = 1 << 7; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 8; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, CHANGE_BOUNDS_TRANSACTION, CHANGE_PIP_CALLBACK, CHANGE_HIDDEN, CHANGE_BOUNDS_TRANSACTION_RECT, CHANGE_IGNORE_ORIENTATION_REQUEST, CHANGE_FORCE_NO_PIP, CHANGE_FORCE_TRANSLUCENT, Loading @@ -1262,7 +1230,6 @@ public final class WindowContainerTransaction implements Parcelable { private Rect mPinnedBounds = null; private SurfaceControl.Transaction mBoundsChangeTransaction = null; private Rect mBoundsChangeSurfaceBounds = null; @Nullable private Rect mRelativeBounds = null; private boolean mConfigAtTransitionEnd = false; Loading Loading @@ -1290,10 +1257,6 @@ public final class WindowContainerTransaction implements Parcelable { mBoundsChangeTransaction = SurfaceControl.Transaction.CREATOR.createFromParcel(in); } if ((mChangeMask & Change.CHANGE_BOUNDS_TRANSACTION_RECT) != 0) { mBoundsChangeSurfaceBounds = new Rect(); mBoundsChangeSurfaceBounds.readFromParcel(in); } if ((mChangeMask & Change.CHANGE_RELATIVE_BOUNDS) != 0) { mRelativeBounds = new Rect(); mRelativeBounds.readFromParcel(in); Loading Loading @@ -1342,10 +1305,6 @@ public final class WindowContainerTransaction implements Parcelable { if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) { mWindowingMode = other.mWindowingMode; } if (other.mBoundsChangeSurfaceBounds != null) { mBoundsChangeSurfaceBounds = transfer ? other.mBoundsChangeSurfaceBounds : new Rect(other.mBoundsChangeSurfaceBounds); } if (other.mRelativeBounds != null) { mRelativeBounds = transfer ? other.mRelativeBounds Loading Loading @@ -1445,11 +1404,6 @@ public final class WindowContainerTransaction implements Parcelable { return mBoundsChangeTransaction; } @Nullable public Rect getBoundsChangeSurfaceBounds() { return mBoundsChangeSurfaceBounds; } @Nullable public Rect getRelativeBounds() { return mRelativeBounds; Loading Loading @@ -1529,9 +1483,6 @@ public final class WindowContainerTransaction implements Parcelable { if (mBoundsChangeTransaction != null) { mBoundsChangeTransaction.writeToParcel(dest, flags); } if (mBoundsChangeSurfaceBounds != null) { mBoundsChangeSurfaceBounds.writeToParcel(dest, flags); } if (mRelativeBounds != null) { mRelativeBounds.writeToParcel(dest, flags); } Loading services/core/java/com/android/server/wm/WindowOrganizerController.java +0 −34 Original line number Diff line number Diff line Loading @@ -756,40 +756,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub t.getTaskFragmentOrganizer()); } } // Queue-up bounds-change transactions for tasks which are now organized. Do // this after hierarchy ops so we have the final organized state. entries = t.getChanges().entrySet().iterator(); while (entries.hasNext()) { final Map.Entry<IBinder, WindowContainerTransaction.Change> entry = entries.next(); final WindowContainer wc = WindowContainer.fromBinder(entry.getKey()); if (wc == null || !wc.isAttached()) { Slog.e(TAG, "Attempt to operate on detached container: " + wc); continue; } final Task task = wc.asTask(); final Rect surfaceBounds = entry.getValue().getBoundsChangeSurfaceBounds(); if (task == null || !task.isAttached() || surfaceBounds == null) { continue; } if (!task.isOrganized()) { final Task parent = task.getParent() != null ? task.getParent().asTask() : null; // Also allow direct children of created-by-organizer tasks to be // controlled. In the future, these will become organized anyways. if (parent == null || !parent.mCreatedByOrganizer) { throw new IllegalArgumentException( "Can't manipulate non-organized task surface " + task); } } final SurfaceControl.Transaction sft = new SurfaceControl.Transaction(); final SurfaceControl sc = task.getSurfaceControl(); sft.setPosition(sc, surfaceBounds.left, surfaceBounds.top); if (surfaceBounds.isEmpty()) { sft.setWindowCrop(sc, null); } else { sft.setWindowCrop(sc, surfaceBounds.width(), surfaceBounds.height()); } task.setMainWindowSizeChangeTransaction(sft); } if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) { mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */); mService.mTaskSupervisor.endDeferResume(); Loading Loading
core/java/android/window/WindowContainerTransaction.java +6 −55 Original line number Diff line number Diff line Loading @@ -203,36 +203,6 @@ public final class WindowContainerTransaction implements Parcelable { return this; } /** * Like {@link #setBoundsChangeTransaction} but instead queues up a setPosition/WindowCrop * on a container's surface control. This is useful when a boundsChangeTransaction needs to be * queued up on a Task that won't be organized until the end of this window-container * transaction. * * This requires that, at the end of this transaction, `task` will be organized; otherwise * the server will throw an IllegalArgumentException. * * WARNING: Use this carefully. Whatever is set here should match the expected bounds after * the transaction completes since it will likely be replaced by it. This call is * intended to pre-emptively set bounds on a surface in sync with a buffer when * otherwise the new bounds and the new buffer would update on different frames. * * TODO(b/134365562): remove once TaskOrg drives full-screen or BLAST is enabled. * * @hide */ @NonNull public WindowContainerTransaction setBoundsChangeTransaction( @NonNull WindowContainerToken task, @NonNull Rect surfaceBounds) { Change chg = getOrCreateChange(task.asBinder()); if (chg.mBoundsChangeSurfaceBounds == null) { chg.mBoundsChangeSurfaceBounds = new Rect(); } chg.mBoundsChangeSurfaceBounds.set(surfaceBounds); chg.mChangeMask |= Change.CHANGE_BOUNDS_TRANSACTION_RECT; return this; } /** * Set the windowing mode of children of a given root task, without changing * the windowing mode of the Task itself. This can be used during transitions Loading Loading @@ -1206,7 +1176,7 @@ public final class WindowContainerTransaction implements Parcelable { @NonNull public static final Creator<WindowContainerTransaction> CREATOR = new Creator<WindowContainerTransaction>() { new Creator<>() { @Override public WindowContainerTransaction createFromParcel(@NonNull Parcel in) { return new WindowContainerTransaction(in); Loading @@ -1227,19 +1197,17 @@ public final class WindowContainerTransaction implements Parcelable { public static final int CHANGE_BOUNDS_TRANSACTION = 1 << 1; public static final int CHANGE_PIP_CALLBACK = 1 << 2; public static final int CHANGE_HIDDEN = 1 << 3; public static final int CHANGE_BOUNDS_TRANSACTION_RECT = 1 << 4; public static final int CHANGE_IGNORE_ORIENTATION_REQUEST = 1 << 5; public static final int CHANGE_FORCE_NO_PIP = 1 << 6; public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 7; public static final int CHANGE_DRAG_RESIZING = 1 << 8; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 9; public static final int CHANGE_IGNORE_ORIENTATION_REQUEST = 1 << 4; public static final int CHANGE_FORCE_NO_PIP = 1 << 5; public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 6; public static final int CHANGE_DRAG_RESIZING = 1 << 7; public static final int CHANGE_RELATIVE_BOUNDS = 1 << 8; @IntDef(flag = true, prefix = { "CHANGE_" }, value = { CHANGE_FOCUSABLE, CHANGE_BOUNDS_TRANSACTION, CHANGE_PIP_CALLBACK, CHANGE_HIDDEN, CHANGE_BOUNDS_TRANSACTION_RECT, CHANGE_IGNORE_ORIENTATION_REQUEST, CHANGE_FORCE_NO_PIP, CHANGE_FORCE_TRANSLUCENT, Loading @@ -1262,7 +1230,6 @@ public final class WindowContainerTransaction implements Parcelable { private Rect mPinnedBounds = null; private SurfaceControl.Transaction mBoundsChangeTransaction = null; private Rect mBoundsChangeSurfaceBounds = null; @Nullable private Rect mRelativeBounds = null; private boolean mConfigAtTransitionEnd = false; Loading Loading @@ -1290,10 +1257,6 @@ public final class WindowContainerTransaction implements Parcelable { mBoundsChangeTransaction = SurfaceControl.Transaction.CREATOR.createFromParcel(in); } if ((mChangeMask & Change.CHANGE_BOUNDS_TRANSACTION_RECT) != 0) { mBoundsChangeSurfaceBounds = new Rect(); mBoundsChangeSurfaceBounds.readFromParcel(in); } if ((mChangeMask & Change.CHANGE_RELATIVE_BOUNDS) != 0) { mRelativeBounds = new Rect(); mRelativeBounds.readFromParcel(in); Loading Loading @@ -1342,10 +1305,6 @@ public final class WindowContainerTransaction implements Parcelable { if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) { mWindowingMode = other.mWindowingMode; } if (other.mBoundsChangeSurfaceBounds != null) { mBoundsChangeSurfaceBounds = transfer ? other.mBoundsChangeSurfaceBounds : new Rect(other.mBoundsChangeSurfaceBounds); } if (other.mRelativeBounds != null) { mRelativeBounds = transfer ? other.mRelativeBounds Loading Loading @@ -1445,11 +1404,6 @@ public final class WindowContainerTransaction implements Parcelable { return mBoundsChangeTransaction; } @Nullable public Rect getBoundsChangeSurfaceBounds() { return mBoundsChangeSurfaceBounds; } @Nullable public Rect getRelativeBounds() { return mRelativeBounds; Loading Loading @@ -1529,9 +1483,6 @@ public final class WindowContainerTransaction implements Parcelable { if (mBoundsChangeTransaction != null) { mBoundsChangeTransaction.writeToParcel(dest, flags); } if (mBoundsChangeSurfaceBounds != null) { mBoundsChangeSurfaceBounds.writeToParcel(dest, flags); } if (mRelativeBounds != null) { mRelativeBounds.writeToParcel(dest, flags); } Loading
services/core/java/com/android/server/wm/WindowOrganizerController.java +0 −34 Original line number Diff line number Diff line Loading @@ -756,40 +756,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub t.getTaskFragmentOrganizer()); } } // Queue-up bounds-change transactions for tasks which are now organized. Do // this after hierarchy ops so we have the final organized state. entries = t.getChanges().entrySet().iterator(); while (entries.hasNext()) { final Map.Entry<IBinder, WindowContainerTransaction.Change> entry = entries.next(); final WindowContainer wc = WindowContainer.fromBinder(entry.getKey()); if (wc == null || !wc.isAttached()) { Slog.e(TAG, "Attempt to operate on detached container: " + wc); continue; } final Task task = wc.asTask(); final Rect surfaceBounds = entry.getValue().getBoundsChangeSurfaceBounds(); if (task == null || !task.isAttached() || surfaceBounds == null) { continue; } if (!task.isOrganized()) { final Task parent = task.getParent() != null ? task.getParent().asTask() : null; // Also allow direct children of created-by-organizer tasks to be // controlled. In the future, these will become organized anyways. if (parent == null || !parent.mCreatedByOrganizer) { throw new IllegalArgumentException( "Can't manipulate non-organized task surface " + task); } } final SurfaceControl.Transaction sft = new SurfaceControl.Transaction(); final SurfaceControl sc = task.getSurfaceControl(); sft.setPosition(sc, surfaceBounds.left, surfaceBounds.top); if (surfaceBounds.isEmpty()) { sft.setWindowCrop(sc, null); } else { sft.setWindowCrop(sc, surfaceBounds.width(), surfaceBounds.height()); } task.setMainWindowSizeChangeTransaction(sft); } if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) { mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */); mService.mTaskSupervisor.endDeferResume(); Loading