Merge "Pause is getting scheduled 2 times" am: d1c32f2cbc am: a7bdc3fdb1 am: 573654baec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2454771 Change-Id: I52d333af2eb58be1e56cf65d914c9f41db9cf2ae Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -573,6 +573,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
|
||||
Drawable mEnterpriseThumbnailDrawable;
|
||||
|
||||
boolean mPauseSchedulePendingForPip = false;
|
||||
|
||||
private void updateEnterpriseThumbnailDrawable(Context context) {
|
||||
DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
|
||||
mEnterpriseThumbnailDrawable = dpm.getResources().getDrawable(
|
||||
|
||||
@@ -3625,7 +3625,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
null /* launchIntoPipHostActivity */, "enterPictureInPictureMode",
|
||||
transition);
|
||||
// Continue the pausing process after entering pip.
|
||||
if (r.isState(PAUSING)) {
|
||||
if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) {
|
||||
r.getTask().schedulePauseActivity(r, false /* userLeaving */,
|
||||
false /* pauseImmediately */, true /* autoEnteringPip */, "auto-pip");
|
||||
}
|
||||
|
||||
@@ -1637,6 +1637,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
||||
|
||||
if (prev.attachedToProcess()) {
|
||||
if (shouldAutoPip) {
|
||||
prev.mPauseSchedulePendingForPip = true;
|
||||
boolean didAutoPip = mAtmService.enterPictureInPictureMode(
|
||||
prev, prev.pictureInPictureArgs, false /* fromClient */);
|
||||
ProtoLog.d(WM_DEBUG_STATES, "Auto-PIP allowed, entering PIP mode "
|
||||
@@ -1700,6 +1701,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
||||
boolean pauseImmediately, boolean autoEnteringPip, String reason) {
|
||||
ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending pause: %s", prev);
|
||||
try {
|
||||
prev.mPauseSchedulePendingForPip = false;
|
||||
EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
|
||||
prev.shortComponentName, "userLeaving=" + userLeaving, reason);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user