diff options
| author | 2020-09-03 15:37:14 -0700 | |
|---|---|---|
| committer | 2020-09-14 09:45:44 -0700 | |
| commit | 318397b034a56ffc2160713d445f43e53e06cdac (patch) | |
| tree | 6e93c446b692fcc2550c4a18159759725a14d09e | |
| parent | 9db724816cf2da731379a90fff66b86c3c225886 (diff) | |
Rename autoEnterAllowed to autoEnterEnabled
Bug: 167621602
Test: atest PinnedStackTests#testAutoPipAllowedBypassesExplicitEnterPip
Change-Id: I6e92c138c49b55f8641950bc9c45dd4631d62ee8
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/PictureInPictureParams.java | 36 | ||||
| -rw-r--r-- | core/proto/android/server/windowmanagerservice.proto | 2 | ||||
| -rw-r--r-- | non-updatable-api/current.txt | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 6 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/Task.java | 2 |
7 files changed, 26 insertions, 26 deletions
diff --git a/api/current.txt b/api/current.txt index 69e204b326b6..c4d00e2e5aa2 100644 --- a/api/current.txt +++ b/api/current.txt @@ -6188,7 +6188,7 @@ package android.app { method public android.app.PictureInPictureParams build(); method public android.app.PictureInPictureParams.Builder setActions(java.util.List<android.app.RemoteAction>); method public android.app.PictureInPictureParams.Builder setAspectRatio(android.util.Rational); - method @NonNull public android.app.PictureInPictureParams.Builder setAutoEnterAllowed(boolean); + method @NonNull public android.app.PictureInPictureParams.Builder setAutoEnterEnabled(boolean); method public android.app.PictureInPictureParams.Builder setSourceRectHint(android.graphics.Rect); } diff --git a/core/java/android/app/PictureInPictureParams.java b/core/java/android/app/PictureInPictureParams.java index 18c4d70dd9b0..df53f98a2d75 100644 --- a/core/java/android/app/PictureInPictureParams.java +++ b/core/java/android/app/PictureInPictureParams.java @@ -47,7 +47,7 @@ public final class PictureInPictureParams implements Parcelable { @Nullable private Rect mSourceRectHint; - private boolean mAutoEnterAllowed; + private boolean mAutoEnterEnabled; /** * Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and @@ -106,21 +106,21 @@ public final class PictureInPictureParams implements Parcelable { } /** - * Sets whether the system is allowed to automatically put the activity in - * picture-in-picture mode without needing/waiting for the activity to call + * Sets whether the system will automatically put the activity in picture-in-picture mode + * without needing/waiting for the activity to call * {@link Activity#enterPictureInPictureMode(PictureInPictureParams)}. * * If true, {@link Activity#onPictureInPictureRequested()} will never be called. * * This property is false by default. - * @param autoEnterAllowed {@code true} if the system is allowed to automatically put the - * activity in picture-in-picture mode. + * @param autoEnterEnabled {@code true} if the system will automatically put the activity + * in picture-in-picture mode. * * @return this builder instance. */ @NonNull - public Builder setAutoEnterAllowed(boolean autoEnterAllowed) { - mAutoEnterAllowed = autoEnterAllowed; + public Builder setAutoEnterEnabled(boolean autoEnterEnabled) { + mAutoEnterEnabled = autoEnterEnabled; return this; } @@ -133,7 +133,7 @@ public final class PictureInPictureParams implements Parcelable { */ public PictureInPictureParams build() { PictureInPictureParams params = new PictureInPictureParams(mAspectRatio, mUserActions, - mSourceRectHint, mAutoEnterAllowed); + mSourceRectHint, mAutoEnterEnabled); return params; } } @@ -161,7 +161,7 @@ public final class PictureInPictureParams implements Parcelable { /** * Whether the system is allowed to automatically put the activity in picture-in-picture mode. */ - private boolean mAutoEnterAllowed; + private boolean mAutoEnterEnabled; /** {@hide} */ PictureInPictureParams() { @@ -180,17 +180,17 @@ public final class PictureInPictureParams implements Parcelable { mSourceRectHint = Rect.CREATOR.createFromParcel(in); } if (in.readInt() != 0) { - mAutoEnterAllowed = in.readBoolean(); + mAutoEnterEnabled = in.readBoolean(); } } /** {@hide} */ PictureInPictureParams(Rational aspectRatio, List<RemoteAction> actions, - Rect sourceRectHint, boolean autoEnterAllowed) { + Rect sourceRectHint, boolean autoEnterEnabled) { mAspectRatio = aspectRatio; mUserActions = actions; mSourceRectHint = sourceRectHint; - mAutoEnterAllowed = autoEnterAllowed; + mAutoEnterEnabled = autoEnterEnabled; } /** @@ -207,7 +207,7 @@ public final class PictureInPictureParams implements Parcelable { if (otherArgs.hasSourceBoundsHint()) { mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); } - mAutoEnterAllowed = otherArgs.mAutoEnterAllowed; + mAutoEnterEnabled = otherArgs.mAutoEnterEnabled; } /** @@ -280,11 +280,11 @@ public final class PictureInPictureParams implements Parcelable { } /** - * @return whether auto pip allowed. + * @return whether auto pip is enabled. * @hide */ - public boolean isAutoEnterAllowed() { - return mAutoEnterAllowed; + public boolean isAutoEnterEnabled() { + return mAutoEnterEnabled; } /** @@ -293,7 +293,7 @@ public final class PictureInPictureParams implements Parcelable { */ public boolean empty() { return !hasSourceBoundsHint() && !hasSetActions() && !hasSetAspectRatio() - && !mAutoEnterAllowed; + && !mAutoEnterEnabled; } @Override @@ -323,7 +323,7 @@ public final class PictureInPictureParams implements Parcelable { out.writeInt(0); } out.writeInt(1); - out.writeBoolean(mAutoEnterAllowed); + out.writeBoolean(mAutoEnterEnabled); } public static final @android.annotation.NonNull Creator<PictureInPictureParams> CREATOR = diff --git a/core/proto/android/server/windowmanagerservice.proto b/core/proto/android/server/windowmanagerservice.proto index 3a59a16b54ca..d4b226dead21 100644 --- a/core/proto/android/server/windowmanagerservice.proto +++ b/core/proto/android/server/windowmanagerservice.proto @@ -316,7 +316,7 @@ message ActivityRecordProto { optional bool front_of_task = 28; optional int32 proc_id = 29; optional bool translucent = 30; - optional bool pip_auto_enter_allowed = 31; + optional bool pip_auto_enter_enabled = 31; } /* represents WindowToken */ diff --git a/non-updatable-api/current.txt b/non-updatable-api/current.txt index f6bd7b59af24..48e780626bc3 100644 --- a/non-updatable-api/current.txt +++ b/non-updatable-api/current.txt @@ -6188,7 +6188,7 @@ package android.app { method public android.app.PictureInPictureParams build(); method public android.app.PictureInPictureParams.Builder setActions(java.util.List<android.app.RemoteAction>); method public android.app.PictureInPictureParams.Builder setAspectRatio(android.util.Rational); - method @NonNull public android.app.PictureInPictureParams.Builder setAutoEnterAllowed(boolean); + method @NonNull public android.app.PictureInPictureParams.Builder setAutoEnterEnabled(boolean); method public android.app.PictureInPictureParams.Builder setSourceRectHint(android.graphics.Rect); } diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 59f003d9a0eb..4ed63306c284 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -129,7 +129,7 @@ import static com.android.server.wm.ActivityRecordProto.LAST_SURFACE_SHOWING; import static com.android.server.wm.ActivityRecordProto.NAME; import static com.android.server.wm.ActivityRecordProto.NUM_DRAWN_WINDOWS; import static com.android.server.wm.ActivityRecordProto.NUM_INTERESTING_WINDOWS; -import static com.android.server.wm.ActivityRecordProto.PIP_AUTO_ENTER_ALLOWED; +import static com.android.server.wm.ActivityRecordProto.PIP_AUTO_ENTER_ENABLED; import static com.android.server.wm.ActivityRecordProto.PROC_ID; import static com.android.server.wm.ActivityRecordProto.REPORTED_DRAWN; import static com.android.server.wm.ActivityRecordProto.REPORTED_VISIBLE; @@ -4750,7 +4750,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // returns. Just need to confirm this reasoning makes sense. final boolean deferHidingClient = canEnterPictureInPicture && !isState(STARTED, STOPPING, STOPPED, PAUSED); - if (deferHidingClient && pictureInPictureArgs.isAutoEnterAllowed()) { + if (deferHidingClient && pictureInPictureArgs.isAutoEnterEnabled()) { // Go ahead and just put the activity in pip if it supports auto-pip. mAtmService.enterPictureInPictureMode(this, pictureInPictureArgs); return; @@ -7705,7 +7705,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (hasProcess()) { proto.write(PROC_ID, app.getPid()); } - proto.write(PIP_AUTO_ENTER_ALLOWED, pictureInPictureArgs.isAutoEnterAllowed()); + proto.write(PIP_AUTO_ENTER_ENABLED, pictureInPictureArgs.isAutoEnterEnabled()); } @Override diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index 493992905191..c6e42f36ca9b 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -4864,7 +4864,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { "Requested PIP on an activity that doesn't support it"); } - if (activity.pictureInPictureArgs.isAutoEnterAllowed()) { + if (activity.pictureInPictureArgs.isAutoEnterEnabled()) { enterPictureInPictureMode(activity, activity.pictureInPictureArgs); return; } diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 241f58ecdc6e..1b6c9956559a 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -5456,7 +5456,7 @@ class Task extends WindowContainer<WindowContainer> { // activities a chance to enter Pip before resuming the next activity. final boolean lastResumedCanPip = prev != null && prev.checkEnterPictureInPictureState( "shouldResumeWhilePausing", userLeaving); - if (lastResumedCanPip && prev.pictureInPictureArgs.isAutoEnterAllowed()) { + if (lastResumedCanPip && prev.pictureInPictureArgs.isAutoEnterEnabled()) { shouldAutoPip = true; } else if (!lastResumedCanPip) { pauseImmediately = true; |