diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 249022e4dd4b8..0e74e579624b6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -78,7 +78,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, private boolean mWakeAndUnlocking; protected boolean mAnimateChange; private boolean mUpdatePending; - private boolean mExpanding; + private boolean mTracking; private boolean mAnimateKeyguardFadingOut; protected long mDurationOverride = -1; private long mAnimationDelay; @@ -122,12 +122,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, } public void onTrackingStarted() { - mExpanding = true; + mTracking = true; mDarkenWhileDragging = !mUnlockMethodCache.canSkipBouncer(); } public void onExpandingFinished() { - mExpanding = false; + mTracking = false; } public void setPanelExpansion(float fraction) { @@ -137,7 +137,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, if (mPinnedHeadsUpCount != 0) { updateHeadsUpScrim(false); } - if (mKeyguardFadeoutAnimation != null) { + if (mKeyguardFadeoutAnimation != null && mTracking) { mKeyguardFadeoutAnimation.cancel(); } } @@ -145,7 +145,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, public void setBouncerShowing(boolean showing) { mBouncerShowing = showing; - mAnimateChange = !mExpanding && !mDontAnimateBouncerChanges; + mAnimateChange = !mTracking && !mDontAnimateBouncerChanges; scheduleUpdate(); } @@ -268,7 +268,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, } private void updateScrimKeyguard() { - if (mExpanding && mDarkenWhileDragging) { + if (mTracking && mDarkenWhileDragging) { float behindFraction = Math.max(0, Math.min(mFraction, 1)); float fraction = 1 - behindFraction; fraction = (float) Math.pow(fraction, 0.8f); @@ -277,7 +277,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, setScrimBehindColor(behindFraction * mScrimBehindAlphaKeyguard); } else if (mBouncerShowing && !mBouncerIsKeyguard) { setScrimInFrontColor(getScrimInFrontAlpha()); - setScrimBehindColor(0f); + updateScrimNormal(); } else if (mBouncerShowing) { setScrimInFrontColor(0f); setScrimBehindColor(mScrimBehindAlpha); @@ -473,7 +473,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, } private void updateScrim(boolean animate, View scrim, float alpha, float currentAlpha) { - if (mKeyguardFadingOutInProgress) { + if (mKeyguardFadingOutInProgress && mKeyguardFadeoutAnimation.getCurrentPlayTime() != 0) { return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index a82ffb75c1a3f..42636708fae3c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -332,17 +332,21 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb }); } else { executeAfterKeyguardGoneAction(); - if (mFingerprintUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING) { - mFingerprintUnlockController.startKeyguardFadingAway(); - mPhoneStatusBar.setKeyguardFadingAway(startTime, 0, 240); + boolean wakeUnlockPulsing = + mFingerprintUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING; + if (wakeUnlockPulsing) { + delay = 0; + fadeoutDuration = 240; + } + mPhoneStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration); + mFingerprintUnlockController.startKeyguardFadingAway(); + mBouncer.hide(true /* destroyView */); + updateStates(); + if (wakeUnlockPulsing) { mStatusBarWindowManager.setKeyguardFadingAway(true); mPhoneStatusBar.fadeKeyguardWhilePulsing(); - animateScrimControllerKeyguardFadingOut(0, 240, new Runnable() { - @Override - public void run() { - mPhoneStatusBar.hideKeyguard(); - } - }, false /* skipFirstFrame */); + animateScrimControllerKeyguardFadingOut(delay, fadeoutDuration, + mPhoneStatusBar::hideKeyguard, false /* skipFirstFrame */); } else { mFingerprintUnlockController.startKeyguardFadingAway(); mPhoneStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration); @@ -369,9 +373,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } } mStatusBarWindowManager.setKeyguardShowing(false); - mBouncer.hide(true /* destroyView */); mViewMediatorCallback.keyguardGone(); - updateStates(); } }