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

Commit d47c9777 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Add localBounds in RemoteAnimationTarget" into rvc-dev am: bd8e715c

Change-Id: Ic65bf55c2e765f132d1a6455e5f96a0e2e1485fe
parents ad94ad9d bd8e715c
Loading
Loading
Loading
Loading
+34 −2
Original line number Diff line number Diff line
@@ -20,9 +20,11 @@ import static android.view.RemoteAnimationTargetProto.CLIP_RECT;
import static android.view.RemoteAnimationTargetProto.CONTENT_INSETS;
import static android.view.RemoteAnimationTargetProto.IS_TRANSLUCENT;
import static android.view.RemoteAnimationTargetProto.LEASH;
import static android.view.RemoteAnimationTargetProto.LOCAL_BOUNDS;
import static android.view.RemoteAnimationTargetProto.MODE;
import static android.view.RemoteAnimationTargetProto.POSITION;
import static android.view.RemoteAnimationTargetProto.PREFIX_ORDER_INDEX;
import static android.view.RemoteAnimationTargetProto.SCREEN_SPACE_BOUNDS;
import static android.view.RemoteAnimationTargetProto.SOURCE_CONTAINER_BOUNDS;
import static android.view.RemoteAnimationTargetProto.START_BOUNDS;
import static android.view.RemoteAnimationTargetProto.START_LEASH;
@@ -130,18 +132,37 @@ public class RemoteAnimationTarget implements Parcelable {
     * The source position of the app, in screen spaces coordinates. If the position of the leash
     * is modified from the controlling app, any animation transform needs to be offset by this
     * amount.
     * @deprecated Use {@link #localBounds} instead.
     */
    @Deprecated
    @UnsupportedAppUsage
    public final Point position;

    /**
     * Bounds of the target relative to its parent.
     * When the app target animating on its parent, we need to use the local coordinates relative to
     * its parent with {@code localBounds.left} & {@code localBounds.top} rather than using
     * {@code position} in screen coordinates.
     */
    public final Rect localBounds;

    /**
     * The bounds of the source container the app lives in, in screen space coordinates. If the crop
     * of the leash is modified from the controlling app, it needs to take the source container
     * bounds into account when calculating the crop.
     * @deprecated Renamed to {@link #screenSpaceBounds}
     */
    @Deprecated
    @UnsupportedAppUsage
    public final Rect sourceContainerBounds;

    /**
     * Bounds of the target relative to the screen. If the crop of the leash is modified from the
     * controlling app, it needs to take the screen space bounds into account when calculating the
     * crop.
     */
    public final Rect screenSpaceBounds;

    /**
     * The starting bounds of the source container in screen space coordinates. This is {@code null}
     * if the animation target isn't MODE_CHANGING. Since this is the starting bounds, it's size
@@ -165,7 +186,8 @@ public class RemoteAnimationTarget implements Parcelable {

    public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
            Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
            Rect sourceContainerBounds, WindowConfiguration windowConfig, boolean isNotInRecents,
            Rect localBounds, Rect screenSpaceBounds,
            WindowConfiguration windowConfig, boolean isNotInRecents,
            SurfaceControl startLeash, Rect startBounds) {
        this.mode = mode;
        this.taskId = taskId;
@@ -175,7 +197,9 @@ public class RemoteAnimationTarget implements Parcelable {
        this.contentInsets = new Rect(contentInsets);
        this.prefixOrderIndex = prefixOrderIndex;
        this.position = new Point(position);
        this.sourceContainerBounds = new Rect(sourceContainerBounds);
        this.localBounds = new Rect(localBounds);
        this.sourceContainerBounds = new Rect(screenSpaceBounds);
        this.screenSpaceBounds = new Rect(screenSpaceBounds);
        this.windowConfiguration = windowConfig;
        this.isNotInRecents = isNotInRecents;
        this.startLeash = startLeash;
@@ -191,7 +215,9 @@ public class RemoteAnimationTarget implements Parcelable {
        contentInsets = in.readParcelable(null);
        prefixOrderIndex = in.readInt();
        position = in.readParcelable(null);
        localBounds = in.readParcelable(null);
        sourceContainerBounds = in.readParcelable(null);
        screenSpaceBounds = in.readParcelable(null);
        windowConfiguration = in.readParcelable(null);
        isNotInRecents = in.readBoolean();
        startLeash = in.readParcelable(null);
@@ -213,7 +239,9 @@ public class RemoteAnimationTarget implements Parcelable {
        dest.writeParcelable(contentInsets, 0 /* flags */);
        dest.writeInt(prefixOrderIndex);
        dest.writeParcelable(position, 0 /* flags */);
        dest.writeParcelable(localBounds, 0 /* flags */);
        dest.writeParcelable(sourceContainerBounds, 0 /* flags */);
        dest.writeParcelable(screenSpaceBounds, 0 /* flags */);
        dest.writeParcelable(windowConfiguration, 0 /* flags */);
        dest.writeBoolean(isNotInRecents);
        dest.writeParcelable(startLeash, 0 /* flags */);
@@ -229,6 +257,8 @@ public class RemoteAnimationTarget implements Parcelable {
        pw.print(" prefixOrderIndex="); pw.print(prefixOrderIndex);
        pw.print(" position="); position.printShortString(pw);
        pw.print(" sourceContainerBounds="); sourceContainerBounds.printShortString(pw);
        pw.print(" screenSpaceBounds="); screenSpaceBounds.printShortString(pw);
        pw.print(" localBounds="); localBounds.printShortString(pw);
        pw.println();
        pw.print(prefix); pw.print("windowConfiguration="); pw.println(windowConfiguration);
        pw.print(prefix); pw.print("leash="); pw.println(leash);
@@ -245,6 +275,8 @@ public class RemoteAnimationTarget implements Parcelable {
        proto.write(PREFIX_ORDER_INDEX, prefixOrderIndex);
        position.dumpDebug(proto, POSITION);
        sourceContainerBounds.dumpDebug(proto, SOURCE_CONTAINER_BOUNDS);
        screenSpaceBounds.dumpDebug(proto, SCREEN_SPACE_BOUNDS);
        localBounds.dumpDebug(proto, LOCAL_BOUNDS);
        windowConfiguration.dumpDebug(proto, WINDOW_CONFIGURATION);
        if (startLeash != null) {
            startLeash.dumpDebug(proto, START_LEASH);
+2 −0
Original line number Diff line number Diff line
@@ -44,4 +44,6 @@ message RemoteAnimationTargetProto {
    optional .android.app.WindowConfigurationProto window_configuration = 10;
    optional .android.view.SurfaceControlProto start_leash = 11;
    optional .android.graphics.RectProto start_bounds = 12;
    optional .android.graphics.RectProto local_bounds = 13;
    optional .android.graphics.RectProto screen_space_bounds = 14;
}
+4 −0
Original line number Diff line number Diff line
@@ -44,7 +44,9 @@ public class RemoteAnimationTargetCompat {
    public final Rect clipRect;
    public final int prefixOrderIndex;
    public final Point position;
    public final Rect localBounds;
    public final Rect sourceContainerBounds;
    public final Rect screenSpaceBounds;
    public final boolean isNotInRecents;
    public final Rect contentInsets;

@@ -57,7 +59,9 @@ public class RemoteAnimationTargetCompat {
        isTranslucent = app.isTranslucent;
        clipRect = app.clipRect;
        position = app.position;
        localBounds = app.localBounds;
        sourceContainerBounds = app.sourceContainerBounds;
        screenSpaceBounds = app.screenSpaceBounds;
        prefixOrderIndex = app.prefixOrderIndex;
        isNotInRecents = app.isNotInRecents;
        contentInsets = app.contentInsets;
+1 −1
Original line number Diff line number Diff line
@@ -7620,7 +7620,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return new RemoteAnimationTarget(task.mTaskId, record.getMode(),
                record.mAdapter.mCapturedLeash, !fillsParent(),
                mainWindow.mWinAnimator.mLastClipRect, insets,
                getPrefixOrderIndex(), record.mAdapter.mPosition,
                getPrefixOrderIndex(), record.mAdapter.mPosition, record.mAdapter.mLocalBounds,
                record.mAdapter.mStackBounds, task.getWindowConfiguration(),
                false /*isNotInRecents*/,
                record.mThumbnailAdapter != null ? record.mThumbnailAdapter.mCapturedLeash : null,
+14 −9
Original line number Diff line number Diff line
@@ -820,15 +820,19 @@ public class RecentsAnimationController implements DeathRecipient {
        private @AnimationType int mLastAnimationType;
        private final boolean mIsRecentTaskInvisible;
        private RemoteAnimationTarget mTarget;
        private final Point mPosition = new Point();
        private final Rect mBounds = new Rect();
        // The bounds of the target relative to its parent.
        private Rect mLocalBounds = new Rect();

        TaskAnimationAdapter(Task task, boolean isRecentTaskInvisible) {
            mTask = task;
            mIsRecentTaskInvisible = isRecentTaskInvisible;
            final WindowContainer container = mTask.getParent();
            mBounds.set(container.getDisplayedBounds());
            mPosition.set(mBounds.left, mBounds.top);
            mBounds.set(mTask.getDisplayedBounds());

            mLocalBounds.set(mBounds);
            Point tmpPos = new Point();
            mTask.getRelativeDisplayedPosition(tmpPos);
            mLocalBounds.offsetTo(tmpPos.x, tmpPos.y);
        }

        RemoteAnimationTarget createRemoteAnimationTarget() {
@@ -847,8 +851,9 @@ public class RecentsAnimationController implements DeathRecipient {
                    : MODE_CLOSING;
            mTarget = new RemoteAnimationTarget(mTask.mTaskId, mode, mCapturedLeash,
                    !topApp.fillsParent(), mainWindow.mWinAnimator.mLastClipRect,
                    insets, mTask.getPrefixOrderIndex(), mPosition, mBounds,
                    mTask.getWindowConfiguration(), mIsRecentTaskInvisible, null, null);
                    insets, mTask.getPrefixOrderIndex(), new Point(mBounds.left, mBounds.top),
                    mLocalBounds, mBounds, mTask.getWindowConfiguration(),
                    mIsRecentTaskInvisible, null, null);
            return mTarget;
        }

@@ -862,8 +867,8 @@ public class RecentsAnimationController implements DeathRecipient {
                @AnimationType int type, OnAnimationFinishedCallback finishCallback) {
            // Restore z-layering, position and stack crop until client has a chance to modify it.
            t.setLayer(animationLeash, mTask.getPrefixOrderIndex());
            t.setPosition(animationLeash, mPosition.x, mPosition.y);
            mTmpRect.set(mBounds);
            t.setPosition(animationLeash, mLocalBounds.left, mLocalBounds.top);
            mTmpRect.set(mLocalBounds);
            mTmpRect.offsetTo(0, 0);
            t.setWindowCrop(animationLeash, mTmpRect);
            mCapturedLeash = animationLeash;
@@ -897,7 +902,7 @@ public class RecentsAnimationController implements DeathRecipient {
                pw.print(prefix); pw.println("Target: null");
            }
            pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
            pw.println("mPosition=" + mPosition);
            pw.println("mLocalBounds=" + mLocalBounds);
            pw.println("mBounds=" + mBounds);
            pw.println("mIsRecentTaskInvisible=" + mIsRecentTaskInvisible);
        }
Loading