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

Commit b4300151 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
parent 1766e14e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,12 @@ 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 −1
Original line number Diff line number Diff line
@@ -214,7 +214,6 @@ public final class DozeServiceHost implements DozeHost {
            dozing = false;
        }


        mStatusBarStateController.setIsDozing(dozing);
    }

+3 −4
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ public class LockscreenLockIconController {
    private boolean mKeyguardShowing;
    private boolean mKeyguardJustShown;
    private boolean mBlockUpdates;
    private boolean mDozing;
    private boolean mSimLocked;
    private boolean mTransientBiometricsError;
    private boolean mDocked;
@@ -452,7 +451,8 @@ public class LockscreenLockIconController {
            shouldUpdate = false;
        }
        if (shouldUpdate && mLockIcon != null) {
            mLockIcon.update(state, mDozing, mKeyguardJustShown);
            mLockIcon.update(state,
                    mStatusBarStateController.isDozing(), mKeyguardJustShown);
        }
        mLastState = state;
        mKeyguardJustShown = false;
@@ -480,7 +480,6 @@ public class LockscreenLockIconController {
    }

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

@@ -495,7 +494,7 @@ public class LockscreenLockIconController {
     * @return true if the visibility changed
     */
    private boolean updateIconVisibility() {
        boolean onAodOrDocked = mDozing || mDocked;
        boolean onAodOrDocked = mStatusBarStateController.isDozing() && mDocked;
        boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance;
        if (mKeyguardBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) {
            if ((mHeadsUpManagerPhone.isHeadsUpGoingAway()