From ce27776887fb252e08667c16e6945c7fecf33368 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 3 Dec 2009 08:41:44 -0500 Subject: [PATCH] Do not show keyguard if screen is turned off by proximity sensor. Fixes bug b/2300622 (Proximity sensor always blows up the lock screen while in call) Change-Id: I85572973c142a72b3bba0bb032e5d2f710b5e36c Signed-off-by: Mike Lockwood --- .../android/internal/policy/impl/KeyguardViewMediator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java index 6b9db604ee99d..8d711461b11ba 100644 --- a/policy/com/android/internal/policy/impl/KeyguardViewMediator.java +++ b/policy/com/android/internal/policy/impl/KeyguardViewMediator.java @@ -280,8 +280,9 @@ public class KeyguardViewMediator implements KeyguardViewCallback, /** * Called to let us know the screen was turned off. - * @param why either {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER} or - * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. + * @param why either {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER}, + * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT} or + * {@link WindowManagerPolicy#OFF_BECAUSE_OF_PROX_SENSOR}. */ public void onScreenTurnedOff(int why) { synchronized (this) { @@ -312,6 +313,8 @@ public class KeyguardViewMediator implements KeyguardViewCallback, sender); if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = " + mDelayedShowingSequence); + } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR) { + // Do not enable the keyguard if the prox sensor forced the screen off. } else { doKeyguard(); }