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

Commit 67b29d5d authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix wake-and-unlock animation

Since okToDisplay was false when we started the keyguard exit
animation, no animation was applied and we didn't create a
starting window, which lead to flickering. We fix this by
allowing animations from mScreenOnEarly.

Furthermore, we synchronize the navigation bar better with the
rest of the animation.

We also need to apply no animation to the status bar window as
we go through performShowLocked because we were waiting for it
to draw.

Test: go/wm-smoke
Test: Wake-and-unlock
Test: Make sure no other regression with screen on experience
Change-Id: I5f264b74cc258e8d7f608978edfb1faa5ead385c
Fixes: 38441599
parent 4eb76b2d
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -92,6 +92,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    private boolean mLastBouncerShowing;
    private boolean mLastBouncerShowing;
    private boolean mLastBouncerDismissible;
    private boolean mLastBouncerDismissible;
    protected boolean mLastRemoteInputActive;
    protected boolean mLastRemoteInputActive;
    private boolean mLastDeferScrimFadeOut;


    private OnDismissAction mAfterKeyguardGoneAction;
    private OnDismissAction mAfterKeyguardGoneAction;
    private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
    private final ArrayList<Runnable> mAfterKeyguardGoneRunnables = new ArrayList<>();
@@ -367,7 +368,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
            mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration);
            mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration);
            mFingerprintUnlockController.startKeyguardFadingAway();
            mFingerprintUnlockController.startKeyguardFadingAway();
            mBouncer.hide(true /* destroyView */);
            mBouncer.hide(true /* destroyView */);
            updateStates();
            if (wakeUnlockPulsing) {
            if (wakeUnlockPulsing) {
                mStatusBarWindowManager.setKeyguardFadingAway(true);
                mStatusBarWindowManager.setKeyguardFadingAway(true);
                mStatusBar.fadeKeyguardWhilePulsing();
                mStatusBar.fadeKeyguardWhilePulsing();
@@ -399,6 +399,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                    mFingerprintUnlockController.finishKeyguardFadingAway();
                    mFingerprintUnlockController.finishKeyguardFadingAway();
                }
                }
            }
            }
            updateStates();
            mStatusBarWindowManager.setKeyguardShowing(false);
            mStatusBarWindowManager.setKeyguardShowing(false);
            mViewMediatorCallback.keyguardGone();
            mViewMediatorCallback.keyguardGone();
        }
        }
@@ -569,7 +570,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        mLastBouncerShowing = bouncerShowing;
        mLastBouncerShowing = bouncerShowing;
        mLastBouncerDismissible = bouncerDismissible;
        mLastBouncerDismissible = bouncerDismissible;
        mLastRemoteInputActive = remoteInputActive;
        mLastRemoteInputActive = remoteInputActive;

        mLastDeferScrimFadeOut = mDeferScrimFadeOut;
        mStatusBar.onKeyguardViewManagerStatesUpdated();
        mStatusBar.onKeyguardViewManagerStatesUpdated();
    }
    }


@@ -577,14 +578,16 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     * @return Whether the navigation bar should be made visible based on the current state.
     * @return Whether the navigation bar should be made visible based on the current state.
     */
     */
    protected boolean isNavBarVisible() {
    protected boolean isNavBarVisible() {
        return !(mShowing && !mOccluded) || mBouncer.isShowing() || mRemoteInputActive;
        return (!(mShowing && !mOccluded) || mBouncer.isShowing() || mRemoteInputActive)
                && !mDeferScrimFadeOut;
    }
    }


    /**
    /**
     * @return Whether the navigation bar was made visible based on the last known state.
     * @return Whether the navigation bar was made visible based on the last known state.
     */
     */
    protected boolean getLastNavBarVisible() {
    protected boolean getLastNavBarVisible() {
        return !(mLastShowing && !mLastOccluded) || mLastBouncerShowing || mLastRemoteInputActive;
        return (!(mLastShowing && !mLastOccluded) || mLastBouncerShowing || mLastRemoteInputActive)
                && !mLastDeferScrimFadeOut;
    }
    }


    public boolean shouldDismissOnMenuPressed() {
    public boolean shouldDismissOnMenuPressed() {
+11 −4
Original line number Original line Diff line number Diff line
@@ -3072,13 +3072,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (PRINT_ANIM) Log.i(TAG, "selectAnimation in " + win
        if (PRINT_ANIM) Log.i(TAG, "selectAnimation in " + win
              + ": transit=" + transit);
              + ": transit=" + transit);
        if (win == mStatusBar) {
        if (win == mStatusBar) {
            boolean isKeyguard = (win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0;
            final boolean isKeyguard = (win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0;
            final boolean expanded = win.getAttrs().height == MATCH_PARENT
                    && win.getAttrs().width == MATCH_PARENT;
            if (isKeyguard || expanded) {
                return -1;
            }
            if (transit == TRANSIT_EXIT
            if (transit == TRANSIT_EXIT
                    || transit == TRANSIT_HIDE) {
                    || transit == TRANSIT_HIDE) {
                return isKeyguard ? -1 : R.anim.dock_top_exit;
                return R.anim.dock_top_exit;
            } else if (transit == TRANSIT_ENTER
            } else if (transit == TRANSIT_ENTER
                    || transit == TRANSIT_SHOW) {
                    || transit == TRANSIT_SHOW) {
                return isKeyguard ? -1 : R.anim.dock_top_enter;
                return R.anim.dock_top_enter;
            }
            }
        } else if (win == mNavigationBar) {
        } else if (win == mNavigationBar) {
            if (win.getAttrs().windowAnimations != 0) {
            if (win.getAttrs().windowAnimations != 0) {
@@ -6803,7 +6808,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {


    @Override
    @Override
    public boolean isScreenOn() {
    public boolean isScreenOn() {
        return mScreenOnFully;
        synchronized (mLock) {
            return mScreenOnEarly;
        }
    }
    }


    /** {@inheritDoc} */
    /** {@inheritDoc} */