diff options
author | Jeff Brown <jeffbrown@google.com> | 2012-08-25 13:34:32 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2012-08-25 13:41:35 -0700 |
commit | f75724b3d36d84c881d4052cfd4be766d454c98f (patch) | |
tree | 3407abe81ef9a86e920096a7d0a1d3ad5a61f083 /services/java/com/android/server/power/DisplayPowerState.java | |
parent | ba94170a7a4f78d68fe228e9ee35ed82c4de09c8 (diff) |
Initialize screen state earlier in the boot process.
The system depends on receiving reliable vsync signals from
surface flinger during the boot process. If it doesn't get them
because the screen is off then a hang may occur.
This isn't a problem when surface flinger manages the screen
blanking itself but it is a problem for devices that still
rely on early-suspend. When early-suspend is involved, the
screen may be off without surface flinger knowing. This is a
problem because surface flinger will only synthesize fake
vsyncs when it knows the screen is off, otherwise relying
on the hardware to generate vsync signals itself. Unfortunately,
the hardware won't generate vsync signals if the screen was
turned off by early-suspend, so we have a problem.
Bug: 6975688
Change-Id: Iaf4527f716bf4ea72cc3e6fdaf060855697b02f2
Diffstat (limited to 'services/java/com/android/server/power/DisplayPowerState.java')
-rw-r--r-- | services/java/com/android/server/power/DisplayPowerState.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/java/com/android/server/power/DisplayPowerState.java b/services/java/com/android/server/power/DisplayPowerState.java index 64a0462c3aea..3524a08efd6a 100644 --- a/services/java/com/android/server/power/DisplayPowerState.java +++ b/services/java/com/android/server/power/DisplayPowerState.java @@ -49,8 +49,6 @@ final class DisplayPowerState { private static final int DIRTY_ELECTRON_BEAM = 1 << 1; private static final int DIRTY_BRIGHTNESS = 1 << 2; - private static final int DIRTY_ALL = 0xffffffff; - private final Choreographer mChoreographer; private final ElectronBeam mElectronBeam; private final PhotonicModulator mScreenBrightnessModulator; @@ -68,10 +66,16 @@ final class DisplayPowerState { mElectronBeam = electronBean; mScreenBrightnessModulator = screenBrightnessModulator; + // At boot time, we know that the screen is on and the electron beam + // animation is not playing. We don't know the screen's brightness though, + // so prepare to set it to a known state when the state is next applied. + // Although we set the brightness to full on here, the display power controller + // will reset the brightness to a new level immediately before the changes + // actually have a chance to be applied. mScreenOn = true; mElectronBeamLevel = 1.0f; mScreenBrightness = PowerManager.BRIGHTNESS_ON; - invalidate(DIRTY_ALL); + invalidate(DIRTY_BRIGHTNESS); } public static final FloatProperty<DisplayPowerState> ELECTRON_BEAM_LEVEL = |