Loading packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -50,9 +50,23 @@ public interface DozeHost { */ */ void onSlpiTap(float x, float y); void onSlpiTap(float x, float y); /** * Artificially dim down the the display by changing scrim opacities. * @param scrimOpacity opacity from 0 to 1. */ default void setAodDimmingScrim(float scrimOpacity) {} default void setAodDimmingScrim(float scrimOpacity) {} /** * Sets the actual display brightness. * @param value from 0 to 255. */ void setDozeScreenBrightness(int value); void setDozeScreenBrightness(int value); /** * Makes scrims black and changes animation durations. */ default void prepareForGentleWakeUp() {} void onIgnoreTouchWhilePulsing(boolean ignore); void onIgnoreTouchWhilePulsing(boolean ignore); /** /** Loading packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,10 @@ public class DozeScreenState implements DozeMachine.Part { boolean messagePending = mHandler.hasCallbacks(mApplyPendingScreenState); boolean messagePending = mHandler.hasCallbacks(mApplyPendingScreenState); boolean pulseEnding = oldState == DozeMachine.State.DOZE_PULSE_DONE boolean pulseEnding = oldState == DozeMachine.State.DOZE_PULSE_DONE && newState == DozeMachine.State.DOZE_AOD; && newState == DozeMachine.State.DOZE_AOD; if (messagePending || oldState == DozeMachine.State.INITIALIZED || pulseEnding) { boolean turningOn = (oldState == DozeMachine.State.DOZE_AOD_PAUSED || oldState == DozeMachine.State.DOZE) && newState == DozeMachine.State.DOZE_AOD; boolean justInitialized = oldState == DozeMachine.State.INITIALIZED; if (messagePending || justInitialized || pulseEnding || turningOn) { // During initialization, we hide the navigation bar. That is however only applied after // During initialization, we hide the navigation bar. That is however only applied after // a traversal; setting the screen state here is immediate however, so it can happen // a traversal; setting the screen state here is immediate however, so it can happen // that the screen turns on again before the navigation bar is hidden. To work around // that the screen turns on again before the navigation bar is hidden. To work around Loading @@ -91,7 +94,7 @@ public class DozeScreenState implements DozeMachine.Part { // Delay screen state transitions even longer while animations are running. // Delay screen state transitions even longer while animations are running. boolean shouldDelayTransition = newState == DozeMachine.State.DOZE_AOD boolean shouldDelayTransition = newState == DozeMachine.State.DOZE_AOD && mParameters.shouldControlScreenOff(); && mParameters.shouldControlScreenOff() && !turningOn; if (shouldDelayTransition) { if (shouldDelayTransition) { mWakeLock.setAcquired(true); mWakeLock.setAcquired(true); Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class DozeTriggers implements DozeMachine.Part { // Let's prepare the display to wake-up by drawing black. // Let's prepare the display to wake-up by drawing black. // This will cover the hardware wake-up sequence, where the display // This will cover the hardware wake-up sequence, where the display // becomes black for a few frames. // becomes black for a few frames. mDozeHost.setAodDimmingScrim(255f); mDozeHost.setAodDimmingScrim(1f); } } mMachine.wakeUp(); mMachine.wakeUp(); } } Loading packages/SystemUI/src/com/android/systemui/doze/DozeUi.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class DozeUi implements DozeMachine.Part { break; break; case DOZE: case DOZE: case DOZE_AOD_PAUSED: case DOZE_AOD_PAUSED: mHost.prepareForGentleWakeUp(); unscheduleTimeTick(); unscheduleTimeTick(); break; break; case DOZE_REQUEST_PULSE: case DOZE_REQUEST_PULSE: Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -486,6 +486,20 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo mState.AOD.setAodFrontScrimAlpha(alpha); mState.AOD.setAodFrontScrimAlpha(alpha); } } /** * Set front scrim to black, cancelling animations, in order to prepare to fade them * away once the display turns on. */ public void prepareForGentleWakeUp() { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) { mCurrentInFrontAlpha = 1f; mAnimateChange = false; updateScrims(); mAnimateChange = true; mAnimationDuration = ANIMATION_DURATION_LONG; } } /** /** * If the lock screen sensor is active. * If the lock screen sensor is active. */ */ Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -50,9 +50,23 @@ public interface DozeHost { */ */ void onSlpiTap(float x, float y); void onSlpiTap(float x, float y); /** * Artificially dim down the the display by changing scrim opacities. * @param scrimOpacity opacity from 0 to 1. */ default void setAodDimmingScrim(float scrimOpacity) {} default void setAodDimmingScrim(float scrimOpacity) {} /** * Sets the actual display brightness. * @param value from 0 to 255. */ void setDozeScreenBrightness(int value); void setDozeScreenBrightness(int value); /** * Makes scrims black and changes animation durations. */ default void prepareForGentleWakeUp() {} void onIgnoreTouchWhilePulsing(boolean ignore); void onIgnoreTouchWhilePulsing(boolean ignore); /** /** Loading
packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -82,7 +82,10 @@ public class DozeScreenState implements DozeMachine.Part { boolean messagePending = mHandler.hasCallbacks(mApplyPendingScreenState); boolean messagePending = mHandler.hasCallbacks(mApplyPendingScreenState); boolean pulseEnding = oldState == DozeMachine.State.DOZE_PULSE_DONE boolean pulseEnding = oldState == DozeMachine.State.DOZE_PULSE_DONE && newState == DozeMachine.State.DOZE_AOD; && newState == DozeMachine.State.DOZE_AOD; if (messagePending || oldState == DozeMachine.State.INITIALIZED || pulseEnding) { boolean turningOn = (oldState == DozeMachine.State.DOZE_AOD_PAUSED || oldState == DozeMachine.State.DOZE) && newState == DozeMachine.State.DOZE_AOD; boolean justInitialized = oldState == DozeMachine.State.INITIALIZED; if (messagePending || justInitialized || pulseEnding || turningOn) { // During initialization, we hide the navigation bar. That is however only applied after // During initialization, we hide the navigation bar. That is however only applied after // a traversal; setting the screen state here is immediate however, so it can happen // a traversal; setting the screen state here is immediate however, so it can happen // that the screen turns on again before the navigation bar is hidden. To work around // that the screen turns on again before the navigation bar is hidden. To work around Loading @@ -91,7 +94,7 @@ public class DozeScreenState implements DozeMachine.Part { // Delay screen state transitions even longer while animations are running. // Delay screen state transitions even longer while animations are running. boolean shouldDelayTransition = newState == DozeMachine.State.DOZE_AOD boolean shouldDelayTransition = newState == DozeMachine.State.DOZE_AOD && mParameters.shouldControlScreenOff(); && mParameters.shouldControlScreenOff() && !turningOn; if (shouldDelayTransition) { if (shouldDelayTransition) { mWakeLock.setAcquired(true); mWakeLock.setAcquired(true); Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -201,7 +201,7 @@ public class DozeTriggers implements DozeMachine.Part { // Let's prepare the display to wake-up by drawing black. // Let's prepare the display to wake-up by drawing black. // This will cover the hardware wake-up sequence, where the display // This will cover the hardware wake-up sequence, where the display // becomes black for a few frames. // becomes black for a few frames. mDozeHost.setAodDimmingScrim(255f); mDozeHost.setAodDimmingScrim(1f); } } mMachine.wakeUp(); mMachine.wakeUp(); } } Loading
packages/SystemUI/src/com/android/systemui/doze/DozeUi.java +1 −0 Original line number Original line Diff line number Diff line Loading @@ -130,6 +130,7 @@ public class DozeUi implements DozeMachine.Part { break; break; case DOZE: case DOZE: case DOZE_AOD_PAUSED: case DOZE_AOD_PAUSED: mHost.prepareForGentleWakeUp(); unscheduleTimeTick(); unscheduleTimeTick(); break; break; case DOZE_REQUEST_PULSE: case DOZE_REQUEST_PULSE: Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +14 −0 Original line number Original line Diff line number Diff line Loading @@ -486,6 +486,20 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo mState.AOD.setAodFrontScrimAlpha(alpha); mState.AOD.setAodFrontScrimAlpha(alpha); } } /** * Set front scrim to black, cancelling animations, in order to prepare to fade them * away once the display turns on. */ public void prepareForGentleWakeUp() { if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) { mCurrentInFrontAlpha = 1f; mAnimateChange = false; updateScrims(); mAnimateChange = true; mAnimationDuration = ANIMATION_DURATION_LONG; } } /** /** * If the lock screen sensor is active. * If the lock screen sensor is active. */ */ Loading