diff options
author | Craig Mautner <cmautner@google.com> | 2012-06-18 16:53:27 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2012-06-18 16:53:27 -0700 |
commit | 75fc9de2587f493f79ac6719a57ce76f5b3e73df (patch) | |
tree | 54834e81fb3c0d8f8994dc0a82ad20e7564e7f6d /services/java/com/android/server | |
parent | 8b9c6d51d59898375089e9708325604c227812e0 (diff) | |
download | frameworks_base-75fc9de2587f493f79ac6719a57ce76f5b3e73df.zip frameworks_base-75fc9de2587f493f79ac6719a57ce76f5b3e73df.tar.gz frameworks_base-75fc9de2587f493f79ac6719a57ce76f5b3e73df.tar.bz2 |
More paths for turning on screen immediately.
This fix forces the path through the updateLightsLocked method to turn
the screen on immediately if mWaitingForFirstLightSensor is true. Also
do not clear mWaitingForFirstLightSensor if mPreparingForScreenOn
is true. Wait until it turns false.
Fixes bug 6612418.
Change-Id: I03407e748cce4906a73de1f15df1654649b133c4
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 6695cb9..07665f4 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -2106,6 +2106,10 @@ public class PowerManagerService extends IPowerManager.Stub brightness = mScreenBrightnessDim; } } + if (mWaitingForFirstLightSensor && (newState & SCREEN_ON_BIT) != 0) { + steps = IMMEDIATE_ANIM_STEPS; + } + long identity = Binder.clearCallingIdentity(); try { mBatteryStats.noteScreenBrightness(brightness); @@ -3348,6 +3352,7 @@ public class PowerManagerService extends IPowerManager.Stub } SensorEventListener mLightListener = new SensorEventListener() { + @Override public void onSensorChanged(SensorEvent event) { if (mDebugLightSensor) { Slog.d(TAG, "onSensorChanged: light value: " + event.values[0]); @@ -3358,12 +3363,16 @@ public class PowerManagerService extends IPowerManager.Stub return; } handleLightSensorValue((int)event.values[0], mWaitingForFirstLightSensor); - if (mWaitingForFirstLightSensor) { + if (mWaitingForFirstLightSensor && !mPreparingForScreenOn) { + if (mDebugLightAnimation) { + Slog.d(TAG, "onSensorChanged: Clearing mWaitingForFirstLightSensor."); + } mWaitingForFirstLightSensor = false; } } } + @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { // ignore } |