diff options
author | Mike Lockwood <lockwood@android.com> | 2010-04-19 08:18:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-04-19 08:18:58 -0700 |
commit | 3110bf6df1cb6d548e678cdcbb8c7349b2ac0d8a (patch) | |
tree | 90e85fd60dc1f921f5bc630cb0899be64a7f132b /services | |
parent | 7171ea8179e09270e4d6ab825a2320816eee39c5 (diff) | |
parent | 48358bd5c1a35c153c024608b4a302b90f62abfd (diff) | |
download | frameworks_base-3110bf6df1cb6d548e678cdcbb8c7349b2ac0d8a.zip frameworks_base-3110bf6df1cb6d548e678cdcbb8c7349b2ac0d8a.tar.gz frameworks_base-3110bf6df1cb6d548e678cdcbb8c7349b2ac0d8a.tar.bz2 |
Merge "Fix inconsistency in how we handle light sensor when battery is low." into froyo
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index c9dd553..b9021b0 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -1730,7 +1730,7 @@ class PowerManagerService extends IPowerManager.Stub } if (offMask != 0) { - //Slog.i(TAG, "Setting brightess off: " + offMask); + if (mSpew) Slog.i(TAG, "Setting brightess off: " + offMask); setLightBrightness(offMask, Power.BRIGHTNESS_OFF); } if (dimMask != 0) { @@ -1739,7 +1739,7 @@ class PowerManagerService extends IPowerManager.Stub brightness > Power.BRIGHTNESS_LOW_BATTERY) { brightness = Power.BRIGHTNESS_LOW_BATTERY; } - //Slog.i(TAG, "Setting brightess dim " + brightness + ": " + offMask); + if (mSpew) Slog.i(TAG, "Setting brightess dim " + brightness + ": " + dimMask); setLightBrightness(dimMask, brightness); } if (onMask != 0) { @@ -1748,7 +1748,7 @@ class PowerManagerService extends IPowerManager.Stub brightness > Power.BRIGHTNESS_LOW_BATTERY) { brightness = Power.BRIGHTNESS_LOW_BATTERY; } - //Slog.i(TAG, "Setting brightess on " + brightness + ": " + onMask); + if (mSpew) Slog.i(TAG, "Setting brightess on " + brightness + ": " + onMask); setLightBrightness(onMask, brightness); } } @@ -1883,6 +1883,10 @@ class PowerManagerService extends IPowerManager.Stub private int applyButtonState(int state) { int brightness = -1; + if ((state & BATTERY_LOW_BIT) != 0) { + // do not override brightness if the battery is low + return state; + } if (mButtonBrightnessOverride >= 0) { brightness = mButtonBrightnessOverride; } else if (mLightSensorButtonBrightness >= 0 && mUseSoftwareAutoBrightness) { @@ -1899,6 +1903,10 @@ class PowerManagerService extends IPowerManager.Stub private int applyKeyboardState(int state) { int brightness = -1; + if ((state & BATTERY_LOW_BIT) != 0) { + // do not override brightness if the battery is low + return state; + } if (!mKeyboardVisible) { brightness = 0; } else if (mButtonBrightnessOverride >= 0) { |