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

Commit 50883d72 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Prevent double animation of lockicon when waking.

If the phone went from pulsing -> awake, it could cause the lock icon
to briefly disappear then reappear. Specifically, this caused it to
appear to animate twice.

This all resulted from the internals of the Doze system briefly being
told that it was neither dozing nor pusling, meaning that it thought
it should hide the lock icon. The rest of the system then caught up,
and it shows the lock icon again, animating it into place.

Fixes: 155411884
Test: manual
Change-Id: I79e1bbde2c5cb5fe588a29111294fab68c546c7c
Merged-In: I79e1bbde2c5cb5fe588a29111294fab68c546c7c
parent de9867d3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,11 @@ public interface StatusBarStateController {
     */
    boolean isDozing();

    /**
     * Is device pulsing.
     */
    boolean isPulsing();

    /**
     * Adds a state listener
     */
+5 −0
Original line number Diff line number Diff line
@@ -177,6 +177,11 @@ public class StatusBarStateControllerImpl implements SysuiStatusBarStateControll
        return mIsDozing;
    }

    @Override
    public boolean isPulsing() {
        return mPulsing;
    }

    @Override
    public float getDozeAmount() {
        return mDozeAmount;
+0 −2
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ public final class DozeServiceHost implements DozeHost {
            dozing = false;
        }


        mStatusBarStateController.setIsDozing(dozing);
    }

@@ -260,7 +259,6 @@ public final class DozeServiceHost implements DozeHost {
                mKeyguardViewMediator.setPulsing(pulsing);
                mNotificationPanel.setPulsing(pulsing);
                mVisualStabilityManager.setPulsing(pulsing);
                mLockscreenLockIconController.setPulsing(pulsing);
                mIgnoreTouchWhilePulsing = false;
                if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) {
                    mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */);
+12 −8
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@ public class LockscreenLockIconController {
    private boolean mKeyguardShowing;
    private boolean mKeyguardJustShown;
    private boolean mBlockUpdates;
    private boolean mPulsing;
    private boolean mDozing;
    private boolean mSimLocked;
    private boolean mTransientBiometricsError;
    private boolean mDocked;
@@ -123,6 +121,11 @@ public class LockscreenLockIconController {
                    setDozing(isDozing);
                }

                @Override
                public void onPulsingChanged(boolean pulsing) {
                    setPulsing(pulsing);
                }

                @Override
                public void onDozeAmountChanged(float linear, float eased) {
                    if (mLockIcon != null) {
@@ -378,8 +381,7 @@ public class LockscreenLockIconController {
    /**
     * Propagate {@link StatusBar} pulsing state.
     */
    public void setPulsing(boolean pulsing) {
        mPulsing = pulsing;
    private void setPulsing(boolean pulsing) {
        update();
    }

@@ -461,7 +463,8 @@ public class LockscreenLockIconController {
            shouldUpdate = false;
        }
        if (shouldUpdate && mLockIcon != null) {
            mLockIcon.update(state, mPulsing, mDozing, mKeyguardJustShown);
            mLockIcon.update(state, mStatusBarStateController.isPulsing(),
                    mStatusBarStateController.isDozing(), mKeyguardJustShown);
        }
        mLastState = state;
        mKeyguardJustShown = false;
@@ -477,7 +480,8 @@ public class LockscreenLockIconController {
            return STATE_LOCK_OPEN;
        } else if (mTransientBiometricsError) {
            return STATE_BIOMETRICS_ERROR;
        } else if (mKeyguardUpdateMonitor.isFaceDetectionRunning() && !mPulsing) {
        } else if (mKeyguardUpdateMonitor.isFaceDetectionRunning()
                && !mStatusBarStateController.isPulsing()) {
            return STATE_SCANNING_FACE;
        } else {
            return STATE_LOCKED;
@@ -489,7 +493,6 @@ public class LockscreenLockIconController {
    }

    private void setDozing(boolean isDozing) {
        mDozing = isDozing;
        update();
    }

@@ -504,7 +507,8 @@ public class LockscreenLockIconController {
     * @return true if the visibility changed
     */
    private boolean updateIconVisibility() {
        boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked);
        boolean onAodNotPulsingOrDocked = mStatusBarStateController.isDozing()
                && (!mStatusBarStateController.isPulsing() || mDocked);
        boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
                || mShowingLaunchAffordance;
        if (mKeyguardBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) {