am fb8910f9: am 6391830d: Merge change 22958 into eclair

Merge commit 'fb8910f958e93b7ad0fcea89fdd1dd579a962b37'

* commit 'fb8910f958e93b7ad0fcea89fdd1dd579a962b37':
  Don't activate keyguard if screen is turned off while proximity sensor is active.
This commit is contained in:
Mike Lockwood
2009-08-27 14:34:58 -07:00
committed by Android Git Automerger
2 changed files with 5 additions and 0 deletions

View File

@@ -355,6 +355,8 @@ public interface WindowManagerPolicy {
public final int OFF_BECAUSE_OF_USER = 1;
/** Screen turned off because of timeout */
public final int OFF_BECAUSE_OF_TIMEOUT = 2;
/** Screen turned off because of proximity sensor */
public final int OFF_BECAUSE_OF_PROXIMITY_SENSOR = 3;
/**
* Magic constant to {@link IWindowManager#setRotation} to not actually

View File

@@ -949,6 +949,9 @@ class PowerManagerService extends IPowerManager.Stub
private void sendNotificationLocked(boolean on, int why)
{
if (mProximitySensorActive) {
why = WindowManagerPolicy.OFF_BECAUSE_OF_PROXIMITY_SENSOR;
}
if (!on) {
mStillNeedSleepNotification = false;
}