am 11e2e9b0: Merge "Don\'t turn the button backlights on if the screen is off. Part 2." into gingerbread

This commit is contained in:
Joe Onorato
2010-10-26 07:24:41 -07:00
committed by Android Git Automerger

View File

@@ -2354,6 +2354,14 @@ class PowerManagerService extends IPowerManager.Stub
Slog.d(TAG, "lightSensorChangedLocked " + value);
}
// Don't do anything if the screen is off.
if ((mPowerState & SCREEN_ON_BIT) == 0) {
if (mDebugLightSensor) {
Slog.d(TAG, "dropping lightSensorChangedLocked because screen is off");
}
return;
}
// do not allow light sensor value to decrease
if (mHighestLightSensorValue < value) {
mHighestLightSensorValue = value;