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

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

Merge "Ensure applying saved fraction when re-entering PiP"

parents b9749465 a5799f8a
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -1015,6 +1015,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    void notifyAppStopped() {
    void notifyAppStopped() {
        if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this);
        if (DEBUG_ADD_REMOVE) Slog.v(TAG, "notifyAppStopped: " + this);
        mAppStopped = true;
        mAppStopped = true;
        // Reset the last saved PiP snap fraction on app stop.
        mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(this);
        destroySurfaces();
        destroySurfaces();
        // Remove any starting window that was added for this app if they are still around.
        // Remove any starting window that was added for this app if they are still around.
        removeStartingWindow();
        removeStartingWindow();
@@ -3076,11 +3078,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    @Override
    @Override
    void setHidden(boolean hidden) {
    void setHidden(boolean hidden) {
        super.setHidden(hidden);
        super.setHidden(hidden);

        if (hidden) {
            // Once the app window is hidden, reset the last saved PiP snap fraction
            mDisplayContent.mPinnedStackControllerLocked.resetReentrySnapFraction(this);
        }
        scheduleAnimation();
        scheduleAnimation();
    }
    }


+7 −3
Original line number Original line Diff line number Diff line
@@ -321,7 +321,9 @@ public class TaskStack extends WindowContainer<Task> implements
     */
     */
    private void setAnimationFinalBounds(Rect sourceHintBounds, Rect destBounds,
    private void setAnimationFinalBounds(Rect sourceHintBounds, Rect destBounds,
            boolean toFullscreen) {
            boolean toFullscreen) {
        if (mAnimationType == BoundsAnimationController.BOUNDS) {
            mBoundsAnimatingRequested = true;
            mBoundsAnimatingRequested = true;
        }
        mBoundsAnimatingToFullscreen = toFullscreen;
        mBoundsAnimatingToFullscreen = toFullscreen;
        if (destBounds != null) {
        if (destBounds != null) {
            mBoundsAnimationTarget.set(destBounds);
            mBoundsAnimationTarget.set(destBounds);
@@ -1586,8 +1588,10 @@ public class TaskStack extends WindowContainer<Task> implements
                return false;
                return false;
            }
            }


            if (animationType == BoundsAnimationController.BOUNDS) {
                mBoundsAnimatingRequested = false;
                mBoundsAnimatingRequested = false;
                mBoundsAnimating = true;
                mBoundsAnimating = true;
            }
            mAnimationType = animationType;
            mAnimationType = animationType;


            // If we are changing UI mode, as in the PiP to fullscreen
            // If we are changing UI mode, as in the PiP to fullscreen