Loading core/java/android/app/PictureInPictureParams.java +27 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.util.Rational; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * Represents a set of parameters used to initialize and update an Activity in picture-in-picture Loading Loading @@ -193,6 +194,16 @@ public final class PictureInPictureParams implements Parcelable { mAutoEnterEnabled = autoEnterEnabled; } /** * Makes a copy from the other picture-in-picture args. * @hide */ public PictureInPictureParams(PictureInPictureParams other) { this(other.mAspectRatio, other.mUserActions, other.hasSourceBoundsHint() ? new Rect(other.getSourceRectHint()) : null, other.mAutoEnterEnabled); } /** * Copies the set parameters from the other picture-in-picture args. * @hide Loading Loading @@ -296,6 +307,22 @@ public final class PictureInPictureParams implements Parcelable { && !mAutoEnterEnabled; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof PictureInPictureParams)) return false; PictureInPictureParams that = (PictureInPictureParams) o; return mAutoEnterEnabled == that.mAutoEnterEnabled && Objects.equals(mAspectRatio, that.mAspectRatio) && Objects.equals(mUserActions, that.mUserActions) && Objects.equals(mSourceRectHint, that.mSourceRectHint); } @Override public int hashCode() { return Objects.hash(mAspectRatio, mUserActions, mSourceRectHint, mAutoEnterEnabled); } @Override public int describeContents() { return 0; Loading core/java/android/app/RemoteAction.java +20 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Parcelable; import android.text.TextUtils; import java.io.PrintWriter; import java.util.Objects; /** * Represents a remote action that can be called from another process. The action can have an Loading Loading @@ -126,6 +127,25 @@ public final class RemoteAction implements Parcelable { return action; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof RemoteAction)) return false; RemoteAction that = (RemoteAction) o; return mEnabled == that.mEnabled && mShouldShowIcon == that.mShouldShowIcon && mIcon.equals(that.mIcon) && mTitle.equals(that.mTitle) && mContentDescription.equals(that.mContentDescription) && mActionIntent.equals(that.mActionIntent); } @Override public int hashCode() { return Objects.hash(mIcon, mTitle, mContentDescription, mActionIntent, mEnabled, mShouldShowIcon); } @Override public int describeContents() { return 0; Loading core/java/android/app/TaskInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class TaskInfo { && isResizeable == that.isResizeable && Objects.equals(positionInParent, that.positionInParent) && equalsLetterboxParams(that) && pictureInPictureParams == that.pictureInPictureParams && Objects.equals(pictureInPictureParams, that.pictureInPictureParams) && getWindowingMode() == that.getWindowingMode() && Objects.equals(taskDescription, that.taskDescription) && isFocused == that.isFocused Loading services/core/java/com/android/server/wm/Task.java +1 −2 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ import com.android.server.uri.NeededUriGrants; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import java.io.FileDescriptor; import java.io.IOException; Loading Loading @@ -4108,7 +4107,7 @@ class Task extends WindowContainer<WindowContainer> { if (top == null) return null; final ActivityRecord rootActivity = top.getRootActivity(); return (rootActivity == null || rootActivity.pictureInPictureArgs.empty()) ? null : rootActivity.pictureInPictureArgs; ? null : new PictureInPictureParams(rootActivity.pictureInPictureArgs); } void maybeUpdateLetterboxBounds( Loading Loading
core/java/android/app/PictureInPictureParams.java +27 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.util.Rational; import java.util.ArrayList; import java.util.List; import java.util.Objects; /** * Represents a set of parameters used to initialize and update an Activity in picture-in-picture Loading Loading @@ -193,6 +194,16 @@ public final class PictureInPictureParams implements Parcelable { mAutoEnterEnabled = autoEnterEnabled; } /** * Makes a copy from the other picture-in-picture args. * @hide */ public PictureInPictureParams(PictureInPictureParams other) { this(other.mAspectRatio, other.mUserActions, other.hasSourceBoundsHint() ? new Rect(other.getSourceRectHint()) : null, other.mAutoEnterEnabled); } /** * Copies the set parameters from the other picture-in-picture args. * @hide Loading Loading @@ -296,6 +307,22 @@ public final class PictureInPictureParams implements Parcelable { && !mAutoEnterEnabled; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof PictureInPictureParams)) return false; PictureInPictureParams that = (PictureInPictureParams) o; return mAutoEnterEnabled == that.mAutoEnterEnabled && Objects.equals(mAspectRatio, that.mAspectRatio) && Objects.equals(mUserActions, that.mUserActions) && Objects.equals(mSourceRectHint, that.mSourceRectHint); } @Override public int hashCode() { return Objects.hash(mAspectRatio, mUserActions, mSourceRectHint, mAutoEnterEnabled); } @Override public int describeContents() { return 0; Loading
core/java/android/app/RemoteAction.java +20 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Parcelable; import android.text.TextUtils; import java.io.PrintWriter; import java.util.Objects; /** * Represents a remote action that can be called from another process. The action can have an Loading Loading @@ -126,6 +127,25 @@ public final class RemoteAction implements Parcelable { return action; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof RemoteAction)) return false; RemoteAction that = (RemoteAction) o; return mEnabled == that.mEnabled && mShouldShowIcon == that.mShouldShowIcon && mIcon.equals(that.mIcon) && mTitle.equals(that.mTitle) && mContentDescription.equals(that.mContentDescription) && mActionIntent.equals(that.mActionIntent); } @Override public int hashCode() { return Objects.hash(mIcon, mTitle, mContentDescription, mActionIntent, mEnabled, mShouldShowIcon); } @Override public int describeContents() { return 0; Loading
core/java/android/app/TaskInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ public class TaskInfo { && isResizeable == that.isResizeable && Objects.equals(positionInParent, that.positionInParent) && equalsLetterboxParams(that) && pictureInPictureParams == that.pictureInPictureParams && Objects.equals(pictureInPictureParams, that.pictureInPictureParams) && getWindowingMode() == that.getWindowingMode() && Objects.equals(taskDescription, that.taskDescription) && isFocused == that.isFocused Loading
services/core/java/com/android/server/wm/Task.java +1 −2 Original line number Diff line number Diff line Loading @@ -224,7 +224,6 @@ import com.android.server.uri.NeededUriGrants; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; import java.io.FileDescriptor; import java.io.IOException; Loading Loading @@ -4108,7 +4107,7 @@ class Task extends WindowContainer<WindowContainer> { if (top == null) return null; final ActivityRecord rootActivity = top.getRootActivity(); return (rootActivity == null || rootActivity.pictureInPictureArgs.empty()) ? null : rootActivity.pictureInPictureArgs; ? null : new PictureInPictureParams(rootActivity.pictureInPictureArgs); } void maybeUpdateLetterboxBounds( Loading