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

Commit 06da5e02 authored by Winson Chung's avatar Winson Chung
Browse files

Remove unused WCT bounds-change-transaction call

Bug: 378565144
Flag: EXEMPT bugfix
Test: m droid
Change-Id: I6537d83fa7543e5bc1de6c971a9d59a26765b166
parent b03d4e6f
Loading
Loading
Loading
Loading
+6 −55
Original line number Original line Diff line number Diff line
@@ -203,36 +203,6 @@ public final class WindowContainerTransaction implements Parcelable {
        return this;
        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
     * 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
     * the windowing mode of the Task itself. This can be used during transitions
@@ -1206,7 +1176,7 @@ public final class WindowContainerTransaction implements Parcelable {


    @NonNull
    @NonNull
    public static final Creator<WindowContainerTransaction> CREATOR =
    public static final Creator<WindowContainerTransaction> CREATOR =
            new Creator<WindowContainerTransaction>() {
            new Creator<>() {
                @Override
                @Override
                public WindowContainerTransaction createFromParcel(@NonNull Parcel in) {
                public WindowContainerTransaction createFromParcel(@NonNull Parcel in) {
                    return new WindowContainerTransaction(in);
                    return new WindowContainerTransaction(in);
@@ -1227,19 +1197,17 @@ public final class WindowContainerTransaction implements Parcelable {
        public static final int CHANGE_BOUNDS_TRANSACTION = 1 << 1;
        public static final int CHANGE_BOUNDS_TRANSACTION = 1 << 1;
        public static final int CHANGE_PIP_CALLBACK = 1 << 2;
        public static final int CHANGE_PIP_CALLBACK = 1 << 2;
        public static final int CHANGE_HIDDEN = 1 << 3;
        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 << 4;
        public static final int CHANGE_IGNORE_ORIENTATION_REQUEST = 1 << 5;
        public static final int CHANGE_FORCE_NO_PIP = 1 << 5;
        public static final int CHANGE_FORCE_NO_PIP = 1 << 6;
        public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 6;
        public static final int CHANGE_FORCE_TRANSLUCENT = 1 << 7;
        public static final int CHANGE_DRAG_RESIZING = 1 << 7;
        public static final int CHANGE_DRAG_RESIZING = 1 << 8;
        public static final int CHANGE_RELATIVE_BOUNDS = 1 << 8;
        public static final int CHANGE_RELATIVE_BOUNDS = 1 << 9;


        @IntDef(flag = true, prefix = { "CHANGE_" }, value = {
        @IntDef(flag = true, prefix = { "CHANGE_" }, value = {
                CHANGE_FOCUSABLE,
                CHANGE_FOCUSABLE,
                CHANGE_BOUNDS_TRANSACTION,
                CHANGE_BOUNDS_TRANSACTION,
                CHANGE_PIP_CALLBACK,
                CHANGE_PIP_CALLBACK,
                CHANGE_HIDDEN,
                CHANGE_HIDDEN,
                CHANGE_BOUNDS_TRANSACTION_RECT,
                CHANGE_IGNORE_ORIENTATION_REQUEST,
                CHANGE_IGNORE_ORIENTATION_REQUEST,
                CHANGE_FORCE_NO_PIP,
                CHANGE_FORCE_NO_PIP,
                CHANGE_FORCE_TRANSLUCENT,
                CHANGE_FORCE_TRANSLUCENT,
@@ -1262,7 +1230,6 @@ public final class WindowContainerTransaction implements Parcelable {


        private Rect mPinnedBounds = null;
        private Rect mPinnedBounds = null;
        private SurfaceControl.Transaction mBoundsChangeTransaction = null;
        private SurfaceControl.Transaction mBoundsChangeTransaction = null;
        private Rect mBoundsChangeSurfaceBounds = null;
        @Nullable
        @Nullable
        private Rect mRelativeBounds = null;
        private Rect mRelativeBounds = null;
        private boolean mConfigAtTransitionEnd = false;
        private boolean mConfigAtTransitionEnd = false;
@@ -1290,10 +1257,6 @@ public final class WindowContainerTransaction implements Parcelable {
                mBoundsChangeTransaction =
                mBoundsChangeTransaction =
                    SurfaceControl.Transaction.CREATOR.createFromParcel(in);
                    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) {
            if ((mChangeMask & Change.CHANGE_RELATIVE_BOUNDS) != 0) {
                mRelativeBounds = new Rect();
                mRelativeBounds = new Rect();
                mRelativeBounds.readFromParcel(in);
                mRelativeBounds.readFromParcel(in);
@@ -1342,10 +1305,6 @@ public final class WindowContainerTransaction implements Parcelable {
            if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) {
            if (other.mWindowingMode >= WINDOWING_MODE_UNDEFINED) {
                mWindowingMode = other.mWindowingMode;
                mWindowingMode = other.mWindowingMode;
            }
            }
            if (other.mBoundsChangeSurfaceBounds != null) {
                mBoundsChangeSurfaceBounds = transfer ? other.mBoundsChangeSurfaceBounds
                        : new Rect(other.mBoundsChangeSurfaceBounds);
            }
            if (other.mRelativeBounds != null) {
            if (other.mRelativeBounds != null) {
                mRelativeBounds = transfer
                mRelativeBounds = transfer
                        ? other.mRelativeBounds
                        ? other.mRelativeBounds
@@ -1445,11 +1404,6 @@ public final class WindowContainerTransaction implements Parcelable {
            return mBoundsChangeTransaction;
            return mBoundsChangeTransaction;
        }
        }


        @Nullable
        public Rect getBoundsChangeSurfaceBounds() {
            return mBoundsChangeSurfaceBounds;
        }

        @Nullable
        @Nullable
        public Rect getRelativeBounds() {
        public Rect getRelativeBounds() {
            return mRelativeBounds;
            return mRelativeBounds;
@@ -1529,9 +1483,6 @@ public final class WindowContainerTransaction implements Parcelable {
            if (mBoundsChangeTransaction != null) {
            if (mBoundsChangeTransaction != null) {
                mBoundsChangeTransaction.writeToParcel(dest, flags);
                mBoundsChangeTransaction.writeToParcel(dest, flags);
            }
            }
            if (mBoundsChangeSurfaceBounds != null) {
                mBoundsChangeSurfaceBounds.writeToParcel(dest, flags);
            }
            if (mRelativeBounds != null) {
            if (mRelativeBounds != null) {
                mRelativeBounds.writeToParcel(dest, flags);
                mRelativeBounds.writeToParcel(dest, flags);
            }
            }
+0 −34
Original line number Original line Diff line number Diff line
@@ -756,40 +756,6 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                            t.getTaskFragmentOrganizer());
                            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) {
            if ((effects & TRANSACT_EFFECTS_LIFECYCLE) != 0) {
                mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
                mService.mTaskSupervisor.setDeferRootVisibilityUpdate(false /* deferUpdate */);
                mService.mTaskSupervisor.endDeferResume();
                mService.mTaskSupervisor.endDeferResume();