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

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

Restore short screen timeout when keyguard is unhidden.



This is part of a fix for bug b/2248320 (Lock screen does not time out after 5 seconds, after call-decline)

Change-Id: I9ad8cc54fe50d8c9862eec27341fabbd0e871bdd
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 09a40408
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -424,6 +424,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
     * Notify us when the keyguard is hidden by another window
     */
    public void setHidden(boolean isHidden) {
        if (DEBUG) Log.d(TAG, "setHidden " + isHidden);
        synchronized (KeyguardViewMediator.this) {
            mHidden = isHidden;
            adjustUserActivityLocked();
@@ -904,7 +905,13 @@ public class KeyguardViewMediator implements KeyguardViewCallback,

    private void adjustUserActivityLocked() {
        // disable user activity if we are shown and not hidden
        mRealPowerManager.enableUserActivity(!mShowing || mHidden);
        if (DEBUG) Log.d(TAG, "adjustUserActivityLocked mShowing: " + mShowing + " mHidden: " + mHidden);
        boolean enabled = !mShowing || mHidden;
        mRealPowerManager.enableUserActivity(enabled);
        if (!enabled && mScreenOn) {
            // reinstate our short screen timeout policy
            pokeWakelock();
        }
    }

    /**