Merge "Make sure scrims will fade from black" into qt-r1-dev

This commit is contained in:
TreeHugger Robot
2019-07-25 04:37:41 +00:00
committed by Android (Google) Code Review
3 changed files with 8 additions and 2 deletions

View File

@@ -491,8 +491,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
* away once the display turns on. * away once the display turns on.
*/ */
public void prepareForGentleWakeUp() { public void prepareForGentleWakeUp() {
if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) { if (mState == ScrimState.AOD) {
mCurrentInFrontAlpha = 1f; mCurrentInFrontAlpha = 1f;
mCurrentInFrontTint = Color.BLACK;
mCurrentBehindTint = Color.BLACK;
mAnimateChange = false; mAnimateChange = false;
updateScrims(); updateScrims();
mAnimateChange = true; mAnimateChange = true;

View File

@@ -129,7 +129,10 @@ public enum ScrimState {
public void prepare(ScrimState previousState) { public void prepare(ScrimState previousState) {
mCurrentInFrontAlpha = 0f; mCurrentInFrontAlpha = 0f;
mCurrentBehindTint = Color.BLACK; mCurrentBehindTint = Color.BLACK;
mCurrentInFrontTint = Color.BLACK;
mBlankScreen = mDisplayRequiresBlanking; mBlankScreen = mDisplayRequiresBlanking;
mAnimationDuration = mWakeLockScreenSensorActive
? ScrimController.ANIMATION_DURATION_LONG : ScrimController.ANIMATION_DURATION;
} }
@Override @Override

View File

@@ -225,11 +225,12 @@ public class ScrimControllerTest extends SysuiTestCase {
mScrimController.transitionTo(ScrimState.PULSING); mScrimController.transitionTo(ScrimState.PULSING);
mScrimController.finishAnimationsImmediately(); mScrimController.finishAnimationsImmediately();
// Front scrim should be transparent // Front scrim should be transparent, but tinted
// Back scrim should be semi-transparent so the user can see the wallpaper // Back scrim should be semi-transparent so the user can see the wallpaper
// Pulse callback should have been invoked // Pulse callback should have been invoked
assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE); assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE);
assertScrimTint(mScrimBehind, true /* tinted */); assertScrimTint(mScrimBehind, true /* tinted */);
assertScrimTint(mScrimInFront, true /* tinted */);
mScrimController.setWakeLockScreenSensorActive(true); mScrimController.setWakeLockScreenSensorActive(true);
mScrimController.finishAnimationsImmediately(); mScrimController.finishAnimationsImmediately();