summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-10-23 14:49:30 -0700
committerJoe Onorato <joeo@android.com>2010-10-23 14:49:57 -0700
commit60607a9012c9b7d39bef8fcf0284772f1b061efc (patch)
treefef35348a027e9846d27c86dca77c73327d10d88 /services
parentb6a2256e5461160a89d077b761d3253d95ce869f (diff)
downloadframeworks_base-60607a9012c9b7d39bef8fcf0284772f1b061efc.zip
frameworks_base-60607a9012c9b7d39bef8fcf0284772f1b061efc.tar.gz
frameworks_base-60607a9012c9b7d39bef8fcf0284772f1b061efc.tar.bz2
Make sure that when the screen is off, we don't try to turn the buttons on too.
Bug: 3117801 Change-Id: I763f114a2b0426660d29bbda04ea7db12c1137e8
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/PowerManagerService.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 638bd45..fadbb34 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -1794,8 +1794,12 @@ class PowerManagerService extends IPowerManager.Stub
private void updateLightsLocked(int newState, int forceState) {
final int oldState = mPowerState;
- newState = applyButtonState(newState);
- newState = applyKeyboardState(newState);
+ if ((newState & SCREEN_ON_BIT) != 0) {
+ // Only turn on the buttons or keyboard if the screen is also on.
+ // We should never see the buttons on but not the screen.
+ newState = applyButtonState(newState);
+ newState = applyKeyboardState(newState);
+ }
final int realDifference = (newState ^ oldState);
final int difference = realDifference | forceState;
if (difference == 0) {
@@ -1898,6 +1902,16 @@ class PowerManagerService extends IPowerManager.Stub
INITIAL_SCREEN_BRIGHTNESS, nominalCurrentValue);
}
+ if (mSpew) {
+ Slog.d(TAG, "offMask=0x" + Integer.toHexString(offMask)
+ + " dimMask=0x" + Integer.toHexString(dimMask)
+ + " onMask=0x" + Integer.toHexString(onMask)
+ + " difference=0x" + Integer.toHexString(difference)
+ + " realDifference=0x" + Integer.toHexString(realDifference)
+ + " forceState=0x" + Integer.toHexString(forceState)
+ );
+ }
+
if (offMask != 0) {
if (mSpew) Slog.i(TAG, "Setting brightess off: " + offMask);
setLightBrightness(offMask, Power.BRIGHTNESS_OFF);