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

Commit 22ce1414 authored by Craig Mautner's avatar Craig Mautner
Browse files

Fix flickering when starting and ending apps.

Surfaces were displaying animations in their entirety for a single
frame before the animation kicked in. This caused a flash on the
screen. By setting the animation to invisible (alpha=0) at their
start it makes no difference if they are displayed.

Fixed bug 6176540.

Removed redundant mDimAnimator.show call.

Change-Id: I47c1b0d38273b011d9115822a8476671d6a050fc
parent f6b8f7b3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -135,6 +135,10 @@ class AppWindowToken extends WindowToken {
            animLayerAdjustment = adj;
            updateLayers();
        }
        // Start out animation gone if window is gone, or visible if window is visible.
        transformation.clear();
        transformation.setAlpha(reportedVisible ? 1 : 0);
        hasTransformation = true;
    }

    public void setDummyAnimation() {
+0 −1
Original line number Diff line number Diff line
@@ -8675,7 +8675,6 @@ public class WindowManagerService extends IWindowManager.Stub
                    } else {
                        mDimAnimator.show(innerDw, innerDh);
                    }
                    mDimAnimator.show(innerDw, innerDh);
                    mDimAnimator.updateParameters(mContext.getResources(),
                            w, currentTime);
                }
+9 −3
Original line number Diff line number Diff line
@@ -640,6 +640,10 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        mAnimation = anim;
        mAnimation.restrictDuration(WindowManagerService.MAX_ANIMATION_DURATION);
        mAnimation.scaleCurrentDuration(mService.mWindowAnimationScale);
        // Start out animation gone if window is gone, or visible if window is visible.
        mTransformation.clear();
        mTransformation.setAlpha(mLastHidden ? 0 : 1);
        mHasLocalTransformation = true;
    }

    public void clearAnimation() {
@@ -933,13 +937,15 @@ final class WindowState implements WindowManagerPolicy.WindowState {
            if (!mService.showSurfaceRobustlyLocked(this)) {
                return false;
            }
            
            mService.enableScreenIfNeededLocked();

            mService.applyEnterAnimationLocked(this);

            mLastAlpha = -1;
            mHasDrawn = true;
            mLastHidden = false;
            mReadyToShow = false;
            mService.enableScreenIfNeededLocked();

            mService.applyEnterAnimationLocked(this);

            int i = mChildWindows.size();
            while (i > 0) {