summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/power/PowerManagerService.java
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2012-08-09 14:47:49 -0400
committerJohn Spurlock <jspurlock@google.com>2012-08-09 14:47:49 -0400
commitb9ba2b6768063b4a4135143bc5b6219fb9b3b22f (patch)
tree1f24c618d2811e1b914c0d4914defbd952b9a5ab /services/java/com/android/server/power/PowerManagerService.java
parent7c46e4380e6c50c30aad80807f87af25f000c7ff (diff)
downloadframeworks_base-b9ba2b6768063b4a4135143bc5b6219fb9b3b22f.zip
frameworks_base-b9ba2b6768063b4a4135143bc5b6219fb9b3b22f.tar.gz
frameworks_base-b9ba2b6768063b4a4135143bc5b6219fb9b3b22f.tar.bz2
Fix screen timeout determination for starting dream.
It turns out OFF_BECAUSE_OF_TIMEOUT is not the best indicator of actual screen timeout. For example, it is the reason passed down when acquiring a wake lock. This was causing us to launch Dreams in the wrong situations, and deadlocking on calls to WindowManager. This fix simply adds an additional check ensuring the intention is to turn the screen off. Change-Id: If8adff446b5b1fcb19424b45878b75bfd0552b90
Diffstat (limited to 'services/java/com/android/server/power/PowerManagerService.java')
-rw-r--r--services/java/com/android/server/power/PowerManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/power/PowerManagerService.java b/services/java/com/android/server/power/PowerManagerService.java
index 1a5f233..2630239 100644
--- a/services/java/com/android/server/power/PowerManagerService.java
+++ b/services/java/com/android/server/power/PowerManagerService.java
@@ -1830,8 +1830,8 @@ public class PowerManagerService extends IPowerManager.Stub
final boolean stateChanged = mPowerState != newState;
- if (stateChanged && reason == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT) {
- if (mPolicy != null && mPolicy.isScreenSaverEnabled() && mIsPowered) {
+ if (stateChanged && !newScreenOn && reason == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT) {
+ if (mPolicy != null && mIsPowered && mPolicy.isScreenSaverEnabled()) {
if (DEBUG) {
Slog.d(TAG, "setPowerState: running screen saver instead of turning off screen");
}