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

Commit b7f3f92a authored by tiger_huang's avatar tiger_huang Committed by Wale Ogunwale
Browse files

Use the correct parent size to initialize animations

The original logic would use out-of-date parent sizes to initialize
animations. If the screen size is changed after assigning mAnimDw and
mAnimDh in the constructor of WindowStateAnimator, the fromDeltaY
(in the most cases) of TranslateAnimation would be initialized
incorrectly.

In this change, we always use up-to-date parent sizes to initialize
animations to prevent the issue.

https://code.google.com/p/android/issues/detail?id=170348

Change-Id: Ib9c609121228934bdb463263feb1924eb389c1d2
parent 0c72f4f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9973,6 +9973,7 @@ public class WindowManagerService extends IWindowManager.Stub
                            winAnimator.setAnimation(a);
                            winAnimator.mAnimDw = w.mLastFrame.left - left;
                            winAnimator.mAnimDh = w.mLastFrame.top - top;
                            winAnimator.mAnimateMove = true;
                        }

                        //TODO (multidisplay): Accessibility supported only for the default display.
+9 −2
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ class WindowStateAnimator {
    // used.
    int mAnimDw;
    int mAnimDh;
    boolean mAnimateMove = false;
    float mDsDx=1, mDtDx=0, mDsDy=0, mDtDy=1;
    float mLastDsDx=1, mLastDtDx=0, mLastDsDy=0, mLastDtDy=1;

@@ -290,9 +291,15 @@ class WindowStateAnimator {
                        " wh=" + mWin.mFrame.height() +
                        " dw=" + mAnimDw + " dh=" + mAnimDh +
                        " scale=" + mService.getWindowAnimationScaleLocked());
                    final DisplayInfo displayInfo = displayContent.getDisplayInfo();
                    if (mAnimateMove) {
                        mAnimateMove = false;
                        mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
                                mAnimDw, mAnimDh);
                    final DisplayInfo displayInfo = displayContent.getDisplayInfo();
                    } else {
                        mAnimation.initialize(mWin.mFrame.width(), mWin.mFrame.height(),
                                displayInfo.appWidth, displayInfo.appHeight);
                    }
                    mAnimDw = displayInfo.appWidth;
                    mAnimDh = displayInfo.appHeight;
                    mAnimation.setStartTime(mAnimationStartTime != -1