Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7c542d1 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Guard onPictureInPictureUiStateChanged with WM lock" into main

parents fd2e5cac 7ee4459b
Loading
Loading
Loading
Loading
+15 −13
Original line number Diff line number Diff line
@@ -4163,6 +4163,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
    @Override
    public void onPictureInPictureUiStateChanged(PictureInPictureUiState pipState) {
        enforceTaskPermission("onPictureInPictureUiStateChanged");
        synchronized (mGlobalLock) {
            // The PictureInPictureUiState is sent to current pip task if there is any
            // -or- the top standard task (state like entering PiP does not require a pinned task).
            final Task task;
@@ -4174,8 +4175,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
            }
            if (task != null && task.getTopMostActivity() != null
                    && !task.getTopMostActivity().isState(FINISHING, DESTROYING, DESTROYED)) {
            mWindowManager.mAtmService.mActivityClientController.onPictureInPictureUiStateChanged(
                    task.getTopMostActivity(), pipState);
                mWindowManager.mAtmService.mActivityClientController
                        .onPictureInPictureUiStateChanged(task.getTopMostActivity(), pipState);
            }
        }
    }