Blank screen when coming from pulse
We need to fade from black to the app to achieve a nice transition.
Test: visual
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
Change-Id: I13edd9c5f7a1bf9378851ac50c513d36ab821c43
Fixes: 87939048
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
index 1c5df58..713356b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
@@ -148,7 +148,7 @@
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);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index a2a866e..40337b8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -351,6 +351,23 @@
}
@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};