Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +22 −14 Original line number Diff line number Diff line Loading @@ -653,6 +653,7 @@ public class KeyguardViewMediator extends SystemUI { final boolean lockImmediately = mLockPatternUtils.getPowerButtonInstantlyLocks(currentUser) || !mLockPatternUtils.isSecure(currentUser); long timeout = getLockTimeout(); if (mExitSecureCallback != null) { if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled"); Loading @@ -667,9 +668,9 @@ public class KeyguardViewMediator extends SystemUI { } } else if (mShowing) { mPendingReset = true; } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT } else if ((why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT && timeout > 0) || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { doKeyguardLaterLocked(); doKeyguardLaterLocked(timeout); } else if (!mLockPatternUtils.isLockScreenDisabled(currentUser)) { mPendingLock = true; } Loading Loading @@ -704,7 +705,7 @@ public class KeyguardViewMediator extends SystemUI { KeyguardUpdateMonitor.getInstance(mContext).dispatchFinishedGoingToSleep(why); } private void doKeyguardLaterLocked() { private long getLockTimeout() { // if the screen turned off because of timeout or the user hit the power button // and we don't need to lock immediately, set an alarm // to enable it a little bit later (i.e, give the user a chance Loading Loading @@ -733,11 +734,19 @@ public class KeyguardViewMediator extends SystemUI { } else { timeout = lockAfterTimeout; } return timeout; } if (timeout <= 0) { // Lock now private void doKeyguardLaterLocked() { long timeout = getLockTimeout(); if (timeout == 0) { doKeyguardLocked(null); } else { doKeyguardLaterLocked(timeout); } } private void doKeyguardLaterLocked(long timeout) { // Lock in the future long when = SystemClock.elapsedRealtime() + timeout; Intent intent = new Intent(DELAYED_KEYGUARD_ACTION); Loading @@ -748,7 +757,6 @@ public class KeyguardViewMediator extends SystemUI { if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = " + mDelayedShowingSequence); } } private void cancelDoKeyguardLaterLocked() { mDelayedShowingSequence++; Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +22 −14 Original line number Diff line number Diff line Loading @@ -653,6 +653,7 @@ public class KeyguardViewMediator extends SystemUI { final boolean lockImmediately = mLockPatternUtils.getPowerButtonInstantlyLocks(currentUser) || !mLockPatternUtils.isSecure(currentUser); long timeout = getLockTimeout(); if (mExitSecureCallback != null) { if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled"); Loading @@ -667,9 +668,9 @@ public class KeyguardViewMediator extends SystemUI { } } else if (mShowing) { mPendingReset = true; } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT } else if ((why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT && timeout > 0) || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { doKeyguardLaterLocked(); doKeyguardLaterLocked(timeout); } else if (!mLockPatternUtils.isLockScreenDisabled(currentUser)) { mPendingLock = true; } Loading Loading @@ -704,7 +705,7 @@ public class KeyguardViewMediator extends SystemUI { KeyguardUpdateMonitor.getInstance(mContext).dispatchFinishedGoingToSleep(why); } private void doKeyguardLaterLocked() { private long getLockTimeout() { // if the screen turned off because of timeout or the user hit the power button // and we don't need to lock immediately, set an alarm // to enable it a little bit later (i.e, give the user a chance Loading Loading @@ -733,11 +734,19 @@ public class KeyguardViewMediator extends SystemUI { } else { timeout = lockAfterTimeout; } return timeout; } if (timeout <= 0) { // Lock now private void doKeyguardLaterLocked() { long timeout = getLockTimeout(); if (timeout == 0) { doKeyguardLocked(null); } else { doKeyguardLaterLocked(timeout); } } private void doKeyguardLaterLocked(long timeout) { // Lock in the future long when = SystemClock.elapsedRealtime() + timeout; Intent intent = new Intent(DELAYED_KEYGUARD_ACTION); Loading @@ -748,7 +757,6 @@ public class KeyguardViewMediator extends SystemUI { if (DEBUG) Log.d(TAG, "setting alarm to turn off keyguard, seq = " + mDelayedShowingSequence); } } private void cancelDoKeyguardLaterLocked() { mDelayedShowingSequence++; Loading