diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java index 02202cf26c38a..fdfd8e88b4465 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java @@ -29,6 +29,7 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.keyguard.LatencyTracker; import com.android.systemui.Dependency; import com.android.systemui.keyguard.KeyguardViewMediator; +import com.android.systemui.keyguard.ScreenLifecycle; import com.android.systemui.keyguard.WakefulnessLifecycle; /** @@ -101,6 +102,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback { private final Context mContext; private int mPendingAuthenticatedUserId = -1; private boolean mPendingShowBouncer; + private boolean mHasScreenTurnedOnSinceAuthenticating; public FingerprintUnlockController(Context context, DozeScrimController dozeScrimController, @@ -113,6 +115,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback { mUpdateMonitor = KeyguardUpdateMonitor.getInstance(context); mUpdateMonitor.registerCallback(this); Dependency.get(WakefulnessLifecycle.class).addObserver(mWakefulnessObserver); + Dependency.get(ScreenLifecycle.class).addObserver(mScreenObserver); mStatusBarWindowManager = Dependency.get(StatusBarWindowManager.class); mDozeScrimController = dozeScrimController; mKeyguardViewMediator = keyguardViewMediator; @@ -186,6 +189,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback { } boolean wasDeviceInteractive = mUpdateMonitor.isDeviceInteractive(); mMode = calculateMode(); + mHasScreenTurnedOnSinceAuthenticating = false; if (mMode == MODE_WAKE_AND_UNLOCK_PULSING && pulsingOrAod()) { // If we are waking the device up while we are pulsing the clock and the // notifications would light up first, creating an unpleasant animation. @@ -228,6 +232,7 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback { true /* allowEnterAnimation */); } else { Trace.beginSection("MODE_WAKE_AND_UNLOCK"); + mDozeScrimController.abortDoze(); } mStatusBarWindowManager.setStatusBarFocusable(false); @@ -354,4 +359,16 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback { } } }; + + private final ScreenLifecycle.Observer mScreenObserver = + new ScreenLifecycle.Observer() { + @Override + public void onScreenTurnedOn() { + mHasScreenTurnedOnSinceAuthenticating = true; + } + }; + + public boolean hasScreenTurnedOnSinceAuthenticating() { + return mHasScreenTurnedOnSinceAuthenticating; + } } 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 e142d628cacc6..acf42785f8267 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -71,6 +71,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb protected final Context mContext; private final StatusBarWindowManager mStatusBarWindowManager; + private final boolean mDisplayBlanksAfterDoze; protected LockPatternUtils mLockPatternUtils; protected ViewMediatorCallback mViewMediatorCallback; @@ -121,6 +122,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mLockPatternUtils = lockPatternUtils; mStatusBarWindowManager = Dependency.get(StatusBarWindowManager.class); KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitorCallback); + mDisplayBlanksAfterDoze = context.getResources().getBoolean( + com.android.internal.R.bool.config_displayBlanksAfterDoze); } public void registerStatusBar(StatusBar statusBar, @@ -373,7 +376,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (!staying) { mStatusBarWindowManager.setKeyguardFadingAway(true); if (mFingerprintUnlockController.getMode() == MODE_WAKE_AND_UNLOCK) { - if (!mScreenTurnedOn) { + boolean turnedOnSinceAuth = + mFingerprintUnlockController.hasScreenTurnedOnSinceAuthenticating(); + if (!mScreenTurnedOn || mDisplayBlanksAfterDoze && !turnedOnSinceAuth) { + // Not ready to animate yet; either because the screen is not on yet, + // or it is on but will turn off before waking out of doze. mDeferScrimFadeOut = true; } else {