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

Merge commit '0d72f7e9fc0d6f774eda5758d111bec5608bcf42' into eclair-mr2

* commit '0d72f7e9fc0d6f774eda5758d111bec5608bcf42':
  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 05:35:04 -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;