diff options
| author | 2024-04-15 09:31:45 +0000 | |
|---|---|---|
| committer | 2024-04-15 09:31:45 +0000 | |
| commit | a40a3b0f98d0ade9c3f85ca2d1e8d47811cebc25 (patch) | |
| tree | b9ad4eee9ff59bdc13215428eb2538e12233144c | |
| parent | c3fd28358029ee69c97391f66037ed8808277fa4 (diff) | |
Fix EnterPipToOtherOrientation failure
The expected behavior is to update the pip task bounds on transition
finish. However, after adding the deferWindowLayout, there can be a
racing condition to update the pip task bounds before the transition
starts.
Revert the deferWindowLayout since it is not enough to bundle all the
enter pip ClientTransaction anyway.
Bug: 334006268
Test: EnterPipToOtherOrientation
Change-Id: I6aa3957b61a62c8e690e56291859d817157903e0
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityTaskManagerService.java | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index a0f615b1ea58..f79c5ca3b434 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -3779,25 +3779,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } EventLogTags.writeWmEnterPip(r.mUserId, System.identityHashCode(r), r.shortComponentName, Boolean.toString(isAutoEnter)); - - // Ensure the ClientTransactionItems are bundled for this operation. - deferWindowLayout(); - try { - r.setPictureInPictureParams(params); - r.mAutoEnteringPip = isAutoEnter; - mRootWindowContainer.moveActivityToPinnedRootTask(r, - null /* launchIntoPipHostActivity */, "enterPictureInPictureMode", - transition); - // Continue the pausing process after entering pip. - if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) { - r.getTask().schedulePauseActivity(r, false /* userLeaving */, - false /* pauseImmediately */, true /* autoEnteringPip */, - "auto-pip"); - } - r.mAutoEnteringPip = false; - } finally { - continueWindowLayout(); - } + r.setPictureInPictureParams(params); + r.mAutoEnteringPip = isAutoEnter; + mRootWindowContainer.moveActivityToPinnedRootTask(r, + null /* launchIntoPipHostActivity */, "enterPictureInPictureMode", + transition); + // Continue the pausing process after entering pip. + if (r.isState(PAUSING) && r.mPauseSchedulePendingForPip) { + r.getTask().schedulePauseActivity(r, false /* userLeaving */, + false /* pauseImmediately */, true /* autoEnteringPip */, + "auto-pip"); + } + r.mAutoEnteringPip = false; } }; |