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

Commit 0dd6aadd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Prevent updating the PiP when it is being dismissed."

parents ac0bdcf9 02e71939
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -7808,10 +7808,15 @@ public class ActivityManagerService extends IActivityManager.Stub
                r.pictureInPictureArgs.copyOnlySet(args);
                if (r.getStack().getStackId() == PINNED_STACK_ID) {
                    // If the activity is already in picture-in-picture, update the pinned stack now
                    // if it is not already expanding to fullscreen. Otherwise, the arguments will
                    // be used the next time the activity enters PiP
                    final PinnedActivityStack stack = r.getStack();
                    stack.setPictureInPictureAspectRatio(r.pictureInPictureArgs.getAspectRatio());
                    if (!stack.isBoundsAnimatingToFullscreen()) {
                        stack.setPictureInPictureAspectRatio(
                                r.pictureInPictureArgs.getAspectRatio());
                        stack.setPictureInPictureActions(r.pictureInPictureArgs.getActions());
                    }
                }
                logPictureInPictureArgs(args);
            }
        } finally {
+4 −0
Original line number Diff line number Diff line
@@ -52,4 +52,8 @@ class PinnedActivityStack extends ActivityStack<PinnedStackWindowController> {
    void setPictureInPictureActions(List<RemoteAction> actions) {
        getWindowContainerController().setPictureInPictureActions(actions);
    }

    boolean isBoundsAnimatingToFullscreen() {
        return getWindowContainerController().isBoundsAnimatingToFullscreen();
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -108,6 +108,13 @@ public class PinnedStackWindowController extends StackWindowController {
        }
    }

    /**
     * @return whether the bounds are currently animating to fullscreen.
     */
    public boolean isBoundsAnimatingToFullscreen() {
        return mContainer.isBoundsAnimatingToFullscreen();
    }

    /**
     * Checks the {@param bounds} and retirms non-null fullscreen bounds for the pinned stack
     * animation if necessary.