summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-08-27 14:31:06 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-08-27 14:31:06 -0700
commit6391830d103ccb19465c69660065c22c2711dcfd (patch)
tree78a1bd1636ce3ecfa506507c27516f2beffc8084
parent18ad9f657bda79069233c0b8e1476888ffd894d4 (diff)
parentddfe879b783ad72603308e28e8f683454464684e (diff)
downloadframeworks_base-6391830d103ccb19465c69660065c22c2711dcfd.zip
frameworks_base-6391830d103ccb19465c69660065c22c2711dcfd.tar.gz
frameworks_base-6391830d103ccb19465c69660065c22c2711dcfd.tar.bz2
Merge change 22958 into eclair
* changes: Don't activate keyguard if screen is turned off while proximity sensor is active.
-rw-r--r--core/java/android/view/WindowManagerPolicy.java2
-rw-r--r--services/java/com/android/server/PowerManagerService.java3
2 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index ea08f33..dd4b65f 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -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
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 621f497..38df47b 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -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;
}