Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce277768 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

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: default avatarMike Lockwood <lockwood@android.com>
parent 5d258b6b
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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();
            }