mCurrentInFrontAlpha = 0;
mAnimationDuration = StatusBar.FADE_KEYGUARD_DURATION;
- if (previousState == ScrimState.AOD) {
+ if (previousState == ScrimState.AOD || previousState == ScrimState.PULSING) {
// Fade from black to transparent when coming directly from AOD
updateScrimColor(mScrimInFront, 1, Color.BLACK);
updateScrimColor(mScrimBehind, 1, Color.BLACK);
}
@Test
+ public void scrimBlanksWhenUnlockingFromPulse() {
+ boolean[] blanked = {false};
+ // Simulate unlock with fingerprint
+ mScrimController.transitionTo(ScrimState.PULSING);
+ mScrimController.finishAnimationsImmediately();
+ mScrimController.transitionTo(ScrimState.UNLOCKED,
+ new ScrimController.Callback() {
+ @Override
+ public void onDisplayBlanked() {
+ blanked[0] = true;
+ }
+ });
+ mScrimController.finishAnimationsImmediately();
+ Assert.assertTrue("Scrim should blank when unlocking from pulse.", blanked[0]);
+ }
+
+ @Test
public void testScrimCallback() {
int[] callOrder = {0, 0, 0};
int[] currentCall = {0};