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

Commit 1735c59a authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "Improve PIP enter transition w/ gesture nav (1/N)"

parents 563c312e 8ea8dbe1
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -326,6 +326,16 @@ public final class PictureInPictureParams implements Parcelable {
        out.writeBoolean(mAutoEnterEnabled);
    }

    @Override
    public String toString() {
        return "PictureInPictureParams("
                + " aspectRatio=" + getAspectRatioRational()
                + " sourceRectHint=" + getSourceRectHint()
                + " hasSetActions=" + hasSetActions()
                + " isAutoPipEnabled=" + isAutoEnterEnabled()
                + ")";
    }

    public static final @android.annotation.NonNull Creator<PictureInPictureParams> CREATOR =
            new Creator<PictureInPictureParams>() {
                public PictureInPictureParams createFromParcel(Parcel in) {
+15 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import static android.view.RemoteAnimationTargetProto.TASK_ID;
import static android.view.RemoteAnimationTargetProto.WINDOW_CONFIGURATION;

import android.annotation.IntDef;
import android.app.PictureInPictureParams;
import android.app.WindowConfiguration;
import android.compat.annotation.UnsupportedAppUsage;
import android.graphics.Point;
@@ -185,11 +186,20 @@ public class RemoteAnimationTarget implements Parcelable {
    @UnsupportedAppUsage
    public boolean isNotInRecents;

    /**
     * {@link PictureInPictureParams} to allow launcher to determine if an app should
     * automatically enter PiP on swiping up to home.
     *
     * TODO: add this to proto dump
     */
    public PictureInPictureParams pictureInPictureParams;

    public RemoteAnimationTarget(int taskId, int mode, SurfaceControl leash, boolean isTranslucent,
            Rect clipRect, Rect contentInsets, int prefixOrderIndex, Point position,
            Rect localBounds, Rect screenSpaceBounds,
            WindowConfiguration windowConfig, boolean isNotInRecents,
            SurfaceControl startLeash, Rect startBounds) {
            SurfaceControl startLeash, Rect startBounds,
            PictureInPictureParams pictureInPictureParams) {
        this.mode = mode;
        this.taskId = taskId;
        this.leash = leash;
@@ -205,6 +215,7 @@ public class RemoteAnimationTarget implements Parcelable {
        this.isNotInRecents = isNotInRecents;
        this.startLeash = startLeash;
        this.startBounds = startBounds == null ? null : new Rect(startBounds);
        this.pictureInPictureParams = pictureInPictureParams;
    }

    public RemoteAnimationTarget(Parcel in) {
@@ -223,6 +234,7 @@ public class RemoteAnimationTarget implements Parcelable {
        isNotInRecents = in.readBoolean();
        startLeash = in.readParcelable(null);
        startBounds = in.readParcelable(null);
        pictureInPictureParams = in.readParcelable(null);
    }

    @Override
@@ -247,6 +259,7 @@ public class RemoteAnimationTarget implements Parcelable {
        dest.writeBoolean(isNotInRecents);
        dest.writeParcelable(startLeash, 0 /* flags */);
        dest.writeParcelable(startBounds, 0 /* flags */);
        dest.writeParcelable(pictureInPictureParams, 0 /* flags */);
    }

    public void dump(PrintWriter pw, String prefix) {
@@ -263,6 +276,7 @@ public class RemoteAnimationTarget implements Parcelable {
        pw.println();
        pw.print(prefix); pw.print("windowConfiguration="); pw.println(windowConfiguration);
        pw.print(prefix); pw.print("leash="); pw.println(leash);
        pw.print(prefix); pw.print("pictureInPictureParams="); pw.println(pictureInPictureParams);
    }

    public void dumpDebug(ProtoOutputStream proto, long fieldId) {
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.shared.system;

import android.app.PictureInPictureParams;
import android.app.WindowConfiguration;
import android.graphics.Point;
import android.graphics.Rect;
@@ -49,6 +50,7 @@ public class RemoteAnimationTargetCompat {
    public final Rect screenSpaceBounds;
    public final boolean isNotInRecents;
    public final Rect contentInsets;
    public final PictureInPictureParams pictureInPictureParams;

    private final SurfaceControl mStartLeash;

@@ -66,6 +68,7 @@ public class RemoteAnimationTargetCompat {
        isNotInRecents = app.isNotInRecents;
        contentInsets = app.contentInsets;
        activityType = app.windowConfiguration.getActivityType();
        pictureInPictureParams = app.pictureInPictureParams;

        mStartLeash = app.startLeash;
    }
+2 −1
Original line number Diff line number Diff line
@@ -7864,6 +7864,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final Rect insets = new Rect();
        mainWindow.getContentInsets(insets);
        InsetUtils.addInsets(insets, getLetterboxInsets());

        return new RemoteAnimationTarget(task.mTaskId, record.getMode(),
                record.mAdapter.mCapturedLeash, !fillsParent(),
                new Rect(), insets,
@@ -7871,7 +7872,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                record.mAdapter.mStackBounds, task.getWindowConfiguration(),
                false /*isNotInRecents*/,
                record.mThumbnailAdapter != null ? record.mThumbnailAdapter.mCapturedLeash : null,
                record.mStartBounds);
                record.mStartBounds, task.getPictureInPictureParams());
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ public class RecentsAnimationController implements DeathRecipient {
                    !topApp.fillsParent(), new Rect(),
                    insets, mTask.getPrefixOrderIndex(), new Point(mBounds.left, mBounds.top),
                    mLocalBounds, mBounds, mTask.getWindowConfiguration(),
                    mIsRecentTaskInvisible, null, null);
                    mIsRecentTaskInvisible, null, null, mTask.getPictureInPictureParams());
            return mTarget;
        }

Loading