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

Commit c1f792d3 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Set the correct PiP mode at the end of the PiP animation.

Previously, we didn't update the PiP at the end of the PiP animation
when the animation type if FADE_IN. That results in map getting stuck
in the PiP even after user puts the PiP window back to fullscreen. This
change takes care of it by covering the FADE_IN case.

Fixes: 129545599
Fixes: 130550078
Fixes: 131812563
Test: atest PinnedStackTests
Change-Id: Ib40b9c6bafaa50f2f0b03cb88ae819bfe75547b5
parent e74b7d23
Loading
Loading
Loading
Loading
+8 −23
Original line number Original line Diff line number Diff line
@@ -1632,21 +1632,6 @@ public class TaskStack extends WindowContainer<Task> implements
    @Override  // AnimatesBounds
    @Override  // AnimatesBounds
    public void onAnimationEnd(boolean schedulePipModeChangedCallback, Rect finalStackSize,
    public void onAnimationEnd(boolean schedulePipModeChangedCallback, Rect finalStackSize,
            boolean moveToFullscreen) {
            boolean moveToFullscreen) {
        if (mAnimationType == BoundsAnimationController.FADE_IN) {
            setPinnedStackAlpha(1f);
            try {
                mWmService.mActivityTaskManager.notifyPinnedStackAnimationEnded();
            } catch (RemoteException e) {
                // I don't believe you...
            }
            return;
        }

        onBoundAnimationEnd(schedulePipModeChangedCallback, finalStackSize, moveToFullscreen);
    }

    private void onBoundAnimationEnd(boolean schedulePipModeChangedCallback, Rect finalStackSize,
            boolean moveToFullscreen) {
        if (inPinnedWindowingMode()) {
        if (inPinnedWindowingMode()) {
            // Update to the final bounds if requested. This is done here instead of in the bounds
            // Update to the final bounds if requested. This is done here instead of in the bounds
            // animator to allow us to coordinate this after we notify the PiP mode changed
            // animator to allow us to coordinate this after we notify the PiP mode changed
@@ -1658,6 +1643,11 @@ public class TaskStack extends WindowContainer<Task> implements
                        mBoundsAnimationTarget, false /* forceUpdate */);
                        mBoundsAnimationTarget, false /* forceUpdate */);
            }
            }


            if (mAnimationType == BoundsAnimationController.FADE_IN) {
                setPinnedStackAlpha(1f);
                mActivityStack.mService.notifyPinnedStackAnimationEnded();
            }

            if (finalStackSize != null && !mCancelCurrentBoundsAnimation) {
            if (finalStackSize != null && !mCancelCurrentBoundsAnimation) {
                setPinnedStackSize(finalStackSize, null);
                setPinnedStackSize(finalStackSize, null);
            } else {
            } else {
@@ -1666,14 +1656,9 @@ public class TaskStack extends WindowContainer<Task> implements
                onPipAnimationEndResize();
                onPipAnimationEndResize();
            }
            }


            try {
            mActivityStack.mService.notifyPinnedStackAnimationEnded();
                mWmService.mActivityTaskManager.notifyPinnedStackAnimationEnded();
            if (moveToFullscreen) {
            if (moveToFullscreen) {
                    mWmService.mActivityTaskManager.moveTasksToFullscreenStack(mStackId,
                mActivityStack.mService.moveTasksToFullscreenStack(mStackId, true /* onTop */);
                            true /* onTop */);
                }
            } catch (RemoteException e) {
                // I don't believe you...
            }
            }
        } else {
        } else {
            // No PiP animation, just run the normal animation-end logic
            // No PiP animation, just run the normal animation-end logic