diff options
| author | 2023-12-08 15:51:48 -0800 | |
|---|---|---|
| committer | 2023-12-09 00:13:48 +0000 | |
| commit | ce3ca40b4c21cf74bcf05afc14013a6ec0875dca (patch) | |
| tree | 50d793f2a76b245f1aba45882143dc0db363ae10 | |
| parent | 04afd06a9045e411ed5c61c21d9784aae6fb307c (diff) | |
Continue pausing after entering pip2
Make sure we schedulePauseActivity after
moving the pip activity to a pinned root task.
Recall that moveActivityToPinnedRootTask is getting
called after PipTransition#handleRequest() in PiP2
since the entry bounds are needed in startWct.
Bug: 315532935
Test: atest CtsWindowManagerDeviceActivity:PinnedStackTests\
#testAutoEnterPipIsInPictureInPictureModeInOnPause
Test: manually auto-enter PiP in 3-btn-nav
Change-Id: I8d754403f895582dacb41e43846c51b273a6f032
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowOrganizerController.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java index a872fd0baaae..4b99432b2943 100644 --- a/services/core/java/com/android/server/wm/WindowOrganizerController.java +++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java @@ -63,6 +63,7 @@ import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_START_SHORTCUT; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_WINDOW_ORGANIZER; +import static com.android.server.wm.ActivityRecord.State.PAUSING; import static com.android.server.wm.ActivityTaskManagerService.enforceTaskPermission; import static com.android.server.wm.ActivityTaskSupervisor.PRESERVE_WINDOWS; import static com.android.server.wm.ActivityTaskSupervisor.REMOVE_FROM_RECENTS; @@ -1178,6 +1179,14 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub mService.mRootWindowContainer.moveActivityToPinnedRootTask( pipActivity, null /* launchIntoPipHostActivity */, "moveActivityToPinnedRootTask", null /* transition */, entryBounds); + + // Continue the pausing process after potential task reparenting. + if (pipActivity.isState(PAUSING) && pipActivity.mPauseSchedulePendingForPip) { + pipActivity.getTask().schedulePauseActivity( + pipActivity, false /* userLeaving */, + false /* pauseImmediately */, true /* autoEnteringPip */, "auto-pip"); + } + effects |= TRANSACT_EFFECTS_LIFECYCLE; break; } |