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 <lockwood@android.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user