diff options
| author | Joe Onorato <joeo@android.com> | 2010-10-24 09:30:05 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-24 09:30:05 -0700 |
| commit | a2a764b9fafb19fd1654c17df996c0cf57741742 (patch) | |
| tree | cd080f3ec057c423ed71b3b6782fbcc4abe8d317 /services/java | |
| parent | 33ac37fc5e4d6d850819024db050054bde1f74b1 (diff) | |
| parent | b34fe2f0258eb1ed512b682206b7fe65116f1dbd (diff) | |
| download | frameworks_base-a2a764b9fafb19fd1654c17df996c0cf57741742.zip frameworks_base-a2a764b9fafb19fd1654c17df996c0cf57741742.tar.gz frameworks_base-a2a764b9fafb19fd1654c17df996c0cf57741742.tar.bz2 | |
am b34fe2f0: am 60607a90: Make sure that when the screen is off, we don\'t try to turn the buttons on too.
Merge commit 'b34fe2f0258eb1ed512b682206b7fe65116f1dbd'
* commit 'b34fe2f0258eb1ed512b682206b7fe65116f1dbd':
Make sure that when the screen is off, we don't try to turn the buttons on too.
Diffstat (limited to 'services/java')
| -rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 18 |
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 76588eb..b3e9f9d 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); |
