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

Merge commit 'bd2473a9aaf0504609e7b8caca00646af53bbed6'

* commit 'bd2473a9aaf0504609e7b8caca00646af53bbed6':
  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:28:21 -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;