diff options
author | Mike Lockwood <lockwood@android.com> | 2010-06-10 14:12:33 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-06-10 14:14:00 -0400 |
commit | f527c715d7065d8cf6943c37dd5e721bd7a805cd (patch) | |
tree | 6b5d282e3bf5bdc3cfd36f5d1eebd1b9012332d9 | |
parent | 71d73a0dfc110d0bdfc1b7ba385db3e2cfe007e5 (diff) | |
download | frameworks_base-f527c715d7065d8cf6943c37dd5e721bd7a805cd.zip frameworks_base-f527c715d7065d8cf6943c37dd5e721bd7a805cd.tar.gz frameworks_base-f527c715d7065d8cf6943c37dd5e721bd7a805cd.tar.bz2 |
Don't adjust lights if screen or button brightness is changed when the screen is off.
Change-Id: I798a240374c3a739e1f1eaf36fa9fdef8416f2a2
BUG: 2758292
Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index b9021b0..493a348 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -1342,10 +1342,13 @@ class PowerManagerService extends IPowerManager.Stub public void setScreenBrightnessOverride(int brightness) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); + if (mSpew) Slog.d(TAG, "setScreenBrightnessOverride " + brightness); synchronized (mLocks) { if (mScreenBrightnessOverride != brightness) { mScreenBrightnessOverride = brightness; - updateLightsLocked(mPowerState, SCREEN_ON_BIT); + if (isScreenOn()) { + updateLightsLocked(mPowerState, SCREEN_ON_BIT); + } } } } @@ -1353,10 +1356,13 @@ class PowerManagerService extends IPowerManager.Stub public void setButtonBrightnessOverride(int brightness) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); + if (mSpew) Slog.d(TAG, "setButtonBrightnessOverride " + brightness); synchronized (mLocks) { if (mButtonBrightnessOverride != brightness) { mButtonBrightnessOverride = brightness; - updateLightsLocked(mPowerState, BUTTON_BRIGHT_BIT | KEYBOARD_BRIGHT_BIT); + if (isScreenOn()) { + updateLightsLocked(mPowerState, BUTTON_BRIGHT_BIT | KEYBOARD_BRIGHT_BIT); + } } } } |