am 0cb3f587: am 0d72f7e9: Fix a race condition that could result in the screen being forced off indefinitely after a phone call.

Merge commit '0cb3f58741efa2b2b7477cbae973a29e614c62e8' into eclair-mr2-plus-aosp

* commit '0cb3f58741efa2b2b7477cbae973a29e614c62e8':
  Fix a race condition that could result in the screen being forced off indefinitely after a phone call.
This commit is contained in:
Mike Lockwood
2009-11-06 10:17:14 -08:00
committed by Android Git Automerger

View File

@@ -2349,11 +2349,9 @@ class PowerManagerService extends IPowerManager.Stub
} finally {
Binder.restoreCallingIdentity(identity);
}
synchronized (mLocks) {
if (mProximitySensorActive) {
mProximitySensorActive = false;
forceUserActivityLocked();
}
if (mProximitySensorActive) {
mProximitySensorActive = false;
forceUserActivityLocked();
}
}
@@ -2361,6 +2359,10 @@ class PowerManagerService extends IPowerManager.Stub
if (mSpew) {
Log.d(TAG, "proximityChangedLocked, active: " + active);
}
if (mProximityCount <= 0) {
Log.d(TAG, "Ignoring proximity change after last proximity lock is released");
return;
}
if (active) {
goToSleepLocked(SystemClock.uptimeMillis());
mProximitySensorActive = true;