summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-10-27 23:07:25 -0400
committerMike Lockwood <lockwood@android.com>2009-10-27 23:13:39 -0400
commit05067120682487df7121b8d2b6f7b02deeb9cd93 (patch)
tree6cc7190003a971432fd7beaa1d0060caf18f0b46
parent8321bdf4dd85b81224d84b0d7a2f53218bf1a250 (diff)
downloadframeworks_base-05067120682487df7121b8d2b6f7b02deeb9cd93.zip
frameworks_base-05067120682487df7121b8d2b6f7b02deeb9cd93.tar.gz
frameworks_base-05067120682487df7121b8d2b6f7b02deeb9cd93.tar.bz2
A better solution for ignoring user activity while the screen is animating off.
Fixes a deadlock that occurred because mAnimatingScreenOff was left set to true after aborting turning off the screen. This change removes the mAnimatingScreenOff flag and checks for (mScreenBrightness.animating && mScreenBrightness.targetValue == 0) instead. Fixes bug b/2219706 Change-Id: I081f08c14ad7585a953fb567867238b1f3db841f Signed-off-by: Mike Lockwood <lockwood@android.com>
-rw-r--r--services/java/com/android/server/PowerManagerService.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 927c1b3..4bf606d 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -158,7 +158,6 @@ class PowerManagerService extends IPowerManager.Stub
private int mProximityCount = 0;
private int mPowerState;
private boolean mOffBecauseOfUser;
- private boolean mAnimatingScreenOff;
private int mUserState;
private boolean mKeyboardVisible = false;
private boolean mUserActivityAllowed = true;
@@ -1232,7 +1231,6 @@ class PowerManagerService extends IPowerManager.Stub
Log.d(TAG,
"preventScreenOn: turning on after a prior preventScreenOn(true)!");
}
- mAnimatingScreenOff = false;
int err = setScreenStateLocked(true);
if (err != 0) {
Log.w(TAG, "preventScreenOn: error from setScreenStateLocked(): " + err);
@@ -1394,7 +1392,6 @@ class PowerManagerService extends IPowerManager.Stub
reallyTurnScreenOn = false;
}
if (reallyTurnScreenOn) {
- mAnimatingScreenOff = false;
err = setScreenStateLocked(true);
long identity = Binder.clearCallingIdentity();
try {
@@ -1436,7 +1433,6 @@ class PowerManagerService extends IPowerManager.Stub
if (!mScreenBrightness.animating) {
err = screenOffFinishedAnimatingLocked(becauseOfUser);
} else {
- mAnimatingScreenOff = true;
mOffBecauseOfUser = becauseOfUser;
err = 0;
mLastTouchDown = 0;
@@ -1454,7 +1450,6 @@ class PowerManagerService extends IPowerManager.Stub
mTotalTouchDownTime, mTouchCycles);
mLastTouchDown = 0;
int err = setScreenStateLocked(false);
- mAnimatingScreenOff = false;
if (mScreenOnStartTime != 0) {
mScreenOnTime += SystemClock.elapsedRealtime() - mScreenOnStartTime;
mScreenOnStartTime = 0;
@@ -1827,9 +1822,6 @@ class PowerManagerService extends IPowerManager.Stub
return;
}
- if (mAnimatingScreenOff) {
- return;
- }
if (false) {
if (((mPokey & POKE_LOCK_IGNORE_CHEEK_EVENTS) != 0)) {
Log.d(TAG, "userActivity !!!");//, new RuntimeException());
@@ -1847,6 +1839,11 @@ class PowerManagerService extends IPowerManager.Stub
+ " mProximitySensorActive=" + mProximitySensorActive
+ " force=" + force);
}
+ // ignore user activity if we are in the process of turning off the screen
+ if (mScreenBrightness.animating && mScreenBrightness.targetValue == 0) {
+ Log.d(TAG, "ignoring user activity while turning off screen");
+ return;
+ }
if (mLastEventTime <= time || force) {
mLastEventTime = time;
if ((mUserActivityAllowed && !mProximitySensorActive) || force) {