Merge "Prevent double animation of lockicon when waking." into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-05-05 14:48:23 +00:00
committed by Android (Google) Code Review
4 changed files with 22 additions and 10 deletions

View File

@@ -39,6 +39,11 @@ public interface StatusBarStateController {
*/ */
boolean isDozing(); boolean isDozing();
/**
* Is device pulsing.
*/
boolean isPulsing();
/** /**
* Adds a state listener * Adds a state listener
*/ */

View File

@@ -177,6 +177,11 @@ public class StatusBarStateControllerImpl implements SysuiStatusBarStateControll
return mIsDozing; return mIsDozing;
} }
@Override
public boolean isPulsing() {
return mPulsing;
}
@Override @Override
public float getDozeAmount() { public float getDozeAmount() {
return mDozeAmount; return mDozeAmount;

View File

@@ -214,7 +214,6 @@ public final class DozeServiceHost implements DozeHost {
dozing = false; dozing = false;
} }
mStatusBarStateController.setIsDozing(dozing); mStatusBarStateController.setIsDozing(dozing);
} }
@@ -260,7 +259,6 @@ public final class DozeServiceHost implements DozeHost {
mKeyguardViewMediator.setPulsing(pulsing); mKeyguardViewMediator.setPulsing(pulsing);
mNotificationPanel.setPulsing(pulsing); mNotificationPanel.setPulsing(pulsing);
mVisualStabilityManager.setPulsing(pulsing); mVisualStabilityManager.setPulsing(pulsing);
mLockscreenLockIconController.setPulsing(pulsing);
mIgnoreTouchWhilePulsing = false; mIgnoreTouchWhilePulsing = false;
if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) { if (mKeyguardUpdateMonitor != null && passiveAuthInterrupt) {
mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */); mKeyguardUpdateMonitor.onAuthInterruptDetected(pulsing /* active */);

View File

@@ -76,8 +76,6 @@ public class LockscreenLockIconController {
private boolean mKeyguardShowing; private boolean mKeyguardShowing;
private boolean mKeyguardJustShown; private boolean mKeyguardJustShown;
private boolean mBlockUpdates; private boolean mBlockUpdates;
private boolean mPulsing;
private boolean mDozing;
private boolean mSimLocked; private boolean mSimLocked;
private boolean mTransientBiometricsError; private boolean mTransientBiometricsError;
private boolean mDocked; private boolean mDocked;
@@ -123,6 +121,11 @@ public class LockscreenLockIconController {
setDozing(isDozing); setDozing(isDozing);
} }
@Override
public void onPulsingChanged(boolean pulsing) {
setPulsing(pulsing);
}
@Override @Override
public void onDozeAmountChanged(float linear, float eased) { public void onDozeAmountChanged(float linear, float eased) {
if (mLockIcon != null) { if (mLockIcon != null) {
@@ -378,8 +381,7 @@ public class LockscreenLockIconController {
/** /**
* Propagate {@link StatusBar} pulsing state. * Propagate {@link StatusBar} pulsing state.
*/ */
public void setPulsing(boolean pulsing) { private void setPulsing(boolean pulsing) {
mPulsing = pulsing;
update(); update();
} }
@@ -461,7 +463,8 @@ public class LockscreenLockIconController {
shouldUpdate = false; shouldUpdate = false;
} }
if (shouldUpdate && mLockIcon != null) { if (shouldUpdate && mLockIcon != null) {
mLockIcon.update(state, mPulsing, mDozing, mKeyguardJustShown); mLockIcon.update(state, mStatusBarStateController.isPulsing(),
mStatusBarStateController.isDozing(), mKeyguardJustShown);
} }
mLastState = state; mLastState = state;
mKeyguardJustShown = false; mKeyguardJustShown = false;
@@ -477,7 +480,8 @@ public class LockscreenLockIconController {
return STATE_LOCK_OPEN; return STATE_LOCK_OPEN;
} else if (mTransientBiometricsError) { } else if (mTransientBiometricsError) {
return STATE_BIOMETRICS_ERROR; return STATE_BIOMETRICS_ERROR;
} else if (mKeyguardUpdateMonitor.isFaceDetectionRunning() && !mPulsing) { } else if (mKeyguardUpdateMonitor.isFaceDetectionRunning()
&& !mStatusBarStateController.isPulsing()) {
return STATE_SCANNING_FACE; return STATE_SCANNING_FACE;
} else { } else {
return STATE_LOCKED; return STATE_LOCKED;
@@ -489,7 +493,6 @@ public class LockscreenLockIconController {
} }
private void setDozing(boolean isDozing) { private void setDozing(boolean isDozing) {
mDozing = isDozing;
update(); update();
} }
@@ -504,7 +507,8 @@ public class LockscreenLockIconController {
* @return true if the visibility changed * @return true if the visibility changed
*/ */
private boolean updateIconVisibility() { private boolean updateIconVisibility() {
boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked); boolean onAodNotPulsingOrDocked = mStatusBarStateController.isDozing()
&& (!mStatusBarStateController.isPulsing() || mDocked);
boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning
|| mShowingLaunchAffordance; || mShowingLaunchAffordance;
if (mKeyguardBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) { if (mKeyguardBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) {