Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +10 −2 Original line number Diff line number Diff line Loading @@ -450,10 +450,18 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo } /** * Sets the front alpha while in AOD. * Sets the front scrim opacity in AOD so it's not as bright. * <p> * Displays usually don't support multiple dimming settings when in low power mode. * The workaround is to modify the front scrim opacity when in AOD, so it's not as * bright when you're at the movies or lying down on bed. * <p> * This value will be lost during transitions and only updated again after the the * device is dozing when the light sensor is on. */ public void setAodFrontScrimAlpha(float alpha) { if (mState == ScrimState.AOD && mCurrentInFrontAlpha != alpha) { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn() && mCurrentInFrontAlpha != alpha) { mCurrentInFrontAlpha = alpha; scheduleUpdate(); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,16 @@ public class ScrimControllerTest extends SysuiTestCase { mScrimController.finishAnimationsImmediately(); assertScrimVisibility(VISIBILITY_FULLY_OPAQUE, VISIBILITY_FULLY_OPAQUE); // ... and alpha updates should be completely ignored if always_on is off. // Passing it forward would mess up the wake-up transition. mAlwaysOnEnabled = false; mScrimController.transitionTo(ScrimState.UNLOCKED); mScrimController.transitionTo(ScrimState.AOD); mScrimController.finishAnimationsImmediately(); mScrimController.setAodFrontScrimAlpha(0.3f); Assert.assertEquals(ScrimState.AOD.getFrontAlpha(), mScrimInFront.getViewAlpha(), 0.001f); Assert.assertNotEquals(0.3f, mScrimInFront.getViewAlpha(), 0.001f); // Reset value since enums are static. mScrimController.setAodFrontScrimAlpha(0f); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +10 −2 Original line number Diff line number Diff line Loading @@ -450,10 +450,18 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo } /** * Sets the front alpha while in AOD. * Sets the front scrim opacity in AOD so it's not as bright. * <p> * Displays usually don't support multiple dimming settings when in low power mode. * The workaround is to modify the front scrim opacity when in AOD, so it's not as * bright when you're at the movies or lying down on bed. * <p> * This value will be lost during transitions and only updated again after the the * device is dozing when the light sensor is on. */ public void setAodFrontScrimAlpha(float alpha) { if (mState == ScrimState.AOD && mCurrentInFrontAlpha != alpha) { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn() && mCurrentInFrontAlpha != alpha) { mCurrentInFrontAlpha = alpha; scheduleUpdate(); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,16 @@ public class ScrimControllerTest extends SysuiTestCase { mScrimController.finishAnimationsImmediately(); assertScrimVisibility(VISIBILITY_FULLY_OPAQUE, VISIBILITY_FULLY_OPAQUE); // ... and alpha updates should be completely ignored if always_on is off. // Passing it forward would mess up the wake-up transition. mAlwaysOnEnabled = false; mScrimController.transitionTo(ScrimState.UNLOCKED); mScrimController.transitionTo(ScrimState.AOD); mScrimController.finishAnimationsImmediately(); mScrimController.setAodFrontScrimAlpha(0.3f); Assert.assertEquals(ScrimState.AOD.getFrontAlpha(), mScrimInFront.getViewAlpha(), 0.001f); Assert.assertNotEquals(0.3f, mScrimInFront.getViewAlpha(), 0.001f); // Reset value since enums are static. mScrimController.setAodFrontScrimAlpha(0f); } Loading