From 15258ac86bb397206ac44c073baf184ffa0e62f2 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 11 Mar 2014 23:02:35 -0700 Subject: Fix power manager display wake lock bugs. (DO NOT MERGE) Under certain circumstances, the power manager might continue to hold the display wakelock long after the display had been turned off due to the mDisplayReady flag having an incorrect value. 1. An inverted conditional caused DisplayPowerState to incorrectly signal the screen on ready state. 2. The DisplayPowerController failed to clear the block screen on flag in the case where the screen was turned off before it became unblocked from turning on. This could happen when the display was rapidly turned on-off-on-off. Bug: 13248135 Change-Id: I8faa3034695c83c8cd35613d81acccf40d22128d --- services/java/com/android/server/power/PowerManagerService.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'services/java/com/android/server/power/PowerManagerService.java') diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java index da9548f..134718b 100644 --- a/services/java/com/android/server/power/PowerManagerService.java +++ b/services/java/com/android/server/power/PowerManagerService.java @@ -1135,6 +1135,9 @@ public final class PowerManagerService extends IPowerManager.Stub if (!mSystemReady || mDirty == 0) { return; } + if (!Thread.holdsLock(mLock)) { + Slog.wtf(TAG, "Power manager lock was not held when calling updatePowerStateLocked"); + } // Phase 0: Basic state updates. updateIsPoweredLocked(mDirty); -- cgit v1.1