Merge "Pause is getting scheduled 2 times"
This commit is contained in:
@@ -557,6 +557,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
|
|
||||||
Drawable mEnterpriseThumbnailDrawable;
|
Drawable mEnterpriseThumbnailDrawable;
|
||||||
|
|
||||||
|
boolean mPauseSchedulePendingForPip = false;
|
||||||
|
|
||||||
private void updateEnterpriseThumbnailDrawable(Context context) {
|
private void updateEnterpriseThumbnailDrawable(Context context) {
|
||||||
DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
|
DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class);
|
||||||
mEnterpriseThumbnailDrawable = dpm.getResources().getDrawable(
|
mEnterpriseThumbnailDrawable = dpm.getResources().getDrawable(
|
||||||
|
|||||||
@@ -3583,7 +3583,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
|||||||
null /* launchIntoPipHostActivity */, "enterPictureInPictureMode",
|
null /* launchIntoPipHostActivity */, "enterPictureInPictureMode",
|
||||||
transition);
|
transition);
|
||||||
// Continue the pausing process after entering pip.
|
// Continue the pausing process after entering pip.
|
||||||
if (r.isState(PAUSING)) {
|
if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) {
|
||||||
r.getTask().schedulePauseActivity(r, false /* userLeaving */,
|
r.getTask().schedulePauseActivity(r, false /* userLeaving */,
|
||||||
false /* pauseImmediately */, true /* autoEnteringPip */, "auto-pip");
|
false /* pauseImmediately */, true /* autoEnteringPip */, "auto-pip");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1619,6 +1619,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
|
|
||||||
if (prev.attachedToProcess()) {
|
if (prev.attachedToProcess()) {
|
||||||
if (shouldAutoPip) {
|
if (shouldAutoPip) {
|
||||||
|
prev.mPauseSchedulePendingForPip = true;
|
||||||
boolean didAutoPip = mAtmService.enterPictureInPictureMode(
|
boolean didAutoPip = mAtmService.enterPictureInPictureMode(
|
||||||
prev, prev.pictureInPictureArgs, false /* fromClient */);
|
prev, prev.pictureInPictureArgs, false /* fromClient */);
|
||||||
ProtoLog.d(WM_DEBUG_STATES, "Auto-PIP allowed, entering PIP mode "
|
ProtoLog.d(WM_DEBUG_STATES, "Auto-PIP allowed, entering PIP mode "
|
||||||
@@ -1682,6 +1683,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
|||||||
boolean pauseImmediately, boolean autoEnteringPip, String reason) {
|
boolean pauseImmediately, boolean autoEnteringPip, String reason) {
|
||||||
ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending pause: %s", prev);
|
ProtoLog.v(WM_DEBUG_STATES, "Enqueueing pending pause: %s", prev);
|
||||||
try {
|
try {
|
||||||
|
prev.mPauseSchedulePendingForPip = false;
|
||||||
EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
|
EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev),
|
||||||
prev.shortComponentName, "userLeaving=" + userLeaving, reason);
|
prev.shortComponentName, "userLeaving=" + userLeaving, reason);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user