Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +5 −4 Original line number Diff line number Diff line Loading @@ -455,11 +455,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo if (mDarkenWhileDragging) { mCurrentBehindAlpha = MathUtils.lerp(GRADIENT_SCRIM_ALPHA_BUSY, alphaBehind, interpolatedFract); mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mState.getFrontAlpha(); } else { mCurrentBehindAlpha = MathUtils.lerp(0 /* start */, alphaBehind, interpolatedFract); mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mState.getFrontAlpha(); } mCurrentBehindTint = ColorUtils.blendARGB(ScrimState.BOUNCER.getBehindTint(), mState.getBehindTint(), interpolatedFract); Loading @@ -485,13 +485,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo * device is dozing when the light sensor is on. */ public void setAodFrontScrimAlpha(float alpha) { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn() && mCurrentInFrontAlpha != alpha) { if (((mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) || mState == ScrimState.PULSING) && mCurrentInFrontAlpha != alpha) { mCurrentInFrontAlpha = alpha; updateScrims(); } mState.AOD.setAodFrontScrimAlpha(alpha); mState.PULSING.setAodFrontScrimAlpha(alpha); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public enum ScrimState { PULSING(5) { @Override public void prepare(ScrimState previousState) { mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mAodFrontScrimAlpha; mCurrentBehindTint = Color.BLACK; mCurrentInFrontTint = Color.BLACK; mBlankScreen = mDisplayRequiresBlanking; Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +12 −2 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class ScrimControllerTest extends SysuiTestCase { } @Test public void transitionToPulsing() { public void transitionToPulsing_withFrontAlphaUpdates() { // Pre-condition // Need to go to AoD first because PULSING doesn't change // the back scrim opacity - otherwise it would hide AoD wallpapers. Loading @@ -233,10 +233,20 @@ public class ScrimControllerTest extends SysuiTestCase { assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE); assertScrimTint(mScrimBehind, true /* tinted */); // ... and when ambient goes dark, front scrim should be semi-transparent mScrimController.setAodFrontScrimAlpha(0.5f); mScrimController.finishAnimationsImmediately(); // Front scrim should be semi-transparent assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */, VISIBILITY_FULLY_OPAQUE /* back */); mScrimController.setWakeLockScreenSensorActive(true); mScrimController.finishAnimationsImmediately(); assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT /* front */, assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */, VISIBILITY_SEMI_TRANSPARENT /* back */); // Reset value since enums are static. mScrimController.setAodFrontScrimAlpha(0f); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +5 −4 Original line number Diff line number Diff line Loading @@ -455,11 +455,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo if (mDarkenWhileDragging) { mCurrentBehindAlpha = MathUtils.lerp(GRADIENT_SCRIM_ALPHA_BUSY, alphaBehind, interpolatedFract); mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mState.getFrontAlpha(); } else { mCurrentBehindAlpha = MathUtils.lerp(0 /* start */, alphaBehind, interpolatedFract); mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mState.getFrontAlpha(); } mCurrentBehindTint = ColorUtils.blendARGB(ScrimState.BOUNCER.getBehindTint(), mState.getBehindTint(), interpolatedFract); Loading @@ -485,13 +485,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo * device is dozing when the light sensor is on. */ public void setAodFrontScrimAlpha(float alpha) { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn() && mCurrentInFrontAlpha != alpha) { if (((mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) || mState == ScrimState.PULSING) && mCurrentInFrontAlpha != alpha) { mCurrentInFrontAlpha = alpha; updateScrims(); } mState.AOD.setAodFrontScrimAlpha(alpha); mState.PULSING.setAodFrontScrimAlpha(alpha); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java +2 −2 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public enum ScrimState { PULSING(5) { @Override public void prepare(ScrimState previousState) { mCurrentInFrontAlpha = 0; mCurrentInFrontAlpha = mAodFrontScrimAlpha; mCurrentBehindTint = Color.BLACK; mCurrentInFrontTint = Color.BLACK; mBlankScreen = mDisplayRequiresBlanking; Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +12 −2 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public class ScrimControllerTest extends SysuiTestCase { } @Test public void transitionToPulsing() { public void transitionToPulsing_withFrontAlphaUpdates() { // Pre-condition // Need to go to AoD first because PULSING doesn't change // the back scrim opacity - otherwise it would hide AoD wallpapers. Loading @@ -233,10 +233,20 @@ public class ScrimControllerTest extends SysuiTestCase { assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE); assertScrimTint(mScrimBehind, true /* tinted */); // ... and when ambient goes dark, front scrim should be semi-transparent mScrimController.setAodFrontScrimAlpha(0.5f); mScrimController.finishAnimationsImmediately(); // Front scrim should be semi-transparent assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */, VISIBILITY_FULLY_OPAQUE /* back */); mScrimController.setWakeLockScreenSensorActive(true); mScrimController.finishAnimationsImmediately(); assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT /* front */, assertScrimVisibility(VISIBILITY_SEMI_TRANSPARENT /* front */, VISIBILITY_SEMI_TRANSPARENT /* back */); // Reset value since enums are static. mScrimController.setAodFrontScrimAlpha(0f); } @Test Loading