diff options
Diffstat (limited to 'services/java/com/android/server/PowerManagerService.java')
-rw-r--r-- | services/java/com/android/server/PowerManagerService.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java index 3e13453..9b54a70 100644 --- a/services/java/com/android/server/PowerManagerService.java +++ b/services/java/com/android/server/PowerManagerService.java @@ -1882,10 +1882,12 @@ class PowerManagerService extends IPowerManager.Stub private Runnable mAutoBrightnessTask = new Runnable() { public void run() { - int value = (int)mLightSensorPendingValue; - if (value >= 0) { - mLightSensorPendingValue = -1; - lightSensorChangedLocked(value); + synchronized (mLocks) { + int value = (int)mLightSensorPendingValue; + if (value >= 0) { + mLightSensorPendingValue = -1; + lightSensorChangedLocked(value); + } } } }; |