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

Commit fb92fcce authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Updates destination bounds upon rotation change" into rvc-dev am: bfdc6696

Change-Id: Ibca5b79f2b505091cbe8be3c97eb9857c183b81d
parents a79d59c2 bfdc6696
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -99,6 +99,10 @@ public class PipAnimationController {
        return mCurrentAnimator;
    }

    PipTransitionAnimator getCurrentAnimator() {
        return mCurrentAnimator;
    }

    private PipTransitionAnimator setupPipTransitionAnimator(PipTransitionAnimator animator) {
        animator.setInterpolator(mFastOutSlowInInterpolator);
        animator.setFloatValues(FRACTION_START, FRACTION_END);
+16 −1
Original line number Diff line number Diff line
@@ -166,7 +166,22 @@ public class PipTaskOrganizer extends ITaskOrganizer.Stub {
     * Updates the display dimension with given {@link DisplayInfo}
     */
    public void onDisplayInfoChanged(DisplayInfo displayInfo) {
        mDisplayBounds.set(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight);
        final Rect newDisplayBounds = new Rect(0, 0,
                displayInfo.logicalWidth, displayInfo.logicalHeight);
        if (!mDisplayBounds.equals(newDisplayBounds)) {
            // Updates the exiting PiP animation in case the screen rotation changes in the middle.
            // It's a legit case that PiP window is in portrait mode on home screen and
            // the application requests landscape onces back to fullscreen mode.
            final PipAnimationController.PipTransitionAnimator animator =
                    mPipAnimationController.getCurrentAnimator();
            if (animator != null
                    && animator.getAnimationType() == ANIM_TYPE_BOUNDS
                    && animator.getDestinationBounds().equals(mDisplayBounds)) {
                animator.updateEndValue(newDisplayBounds);
                animator.setDestinationBounds(newDisplayBounds);
            }
        }
        mDisplayBounds.set(newDisplayBounds);
    }

    /**
+3 −3
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
    private IActivityManager mActivityManager;
    private Handler mHandler = new Handler();

    private final PinnedStackListener mPinnedStackListener = new PipManagerPinnedStackListener();
    private final DisplayInfo mTmpDisplayInfo = new DisplayInfo();
    private final Rect mTmpInsetBounds = new Rect();
    private final Rect mTmpNormalBounds = new Rect();
@@ -211,7 +210,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
        mActivityManager = ActivityManager.getService();

        try {
            WindowManagerWrapper.getInstance().addPinnedStackListener(mPinnedStackListener);
            WindowManagerWrapper.getInstance().addPinnedStackListener(
                    new PipManagerPinnedStackListener());
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to register pinned stack listener", e);
        }
@@ -341,7 +341,6 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio

    private void updateMovementBounds(Rect animatingBounds, boolean fromImeAdjustment,
            boolean fromShelfAdjustment) {
        mPipTaskOrganizer.onDisplayInfoChanged(mTmpDisplayInfo);
        // Populate inset / normal bounds and DisplayInfo from mPipBoundsHandler before
        // passing to mTouchHandler, mTouchHandler would rely on the bounds calculated by
        // mPipBoundsHandler with up-to-dated information
@@ -350,6 +349,7 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
        mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
                animatingBounds, fromImeAdjustment, fromShelfAdjustment,
                mTmpDisplayInfo.rotation);
        mPipTaskOrganizer.onDisplayInfoChanged(mTmpDisplayInfo);
    }

    public void dump(PrintWriter pw) {