Loading packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java +9 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected View mEcaView; protected boolean mEnableHaptics; private boolean mDismissing; private CountDownTimer mCountdownTimer = null; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading Loading @@ -215,11 +216,13 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected void handleAttemptLockout(long elapsedRealtimeDeadline) { setPasswordEntryEnabled(false); long elapsedRealtime = SystemClock.elapsedRealtime(); new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { long secondsInFuture = (long) Math.ceil( (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0); mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { int secondsRemaining = (int) (millisUntilFinished / 1000); int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0); mSecurityMessageDisplay.formatMessage( R.string.kg_too_many_failed_attempts_countdown, secondsRemaining); } Loading Loading @@ -252,6 +255,10 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout @Override public void onPause() { if (mCountdownTimer != null) { mCountdownTimer.cancel(); mCountdownTimer = null; } if (mPendingLockCheck != null) { mPendingLockCheck.cancel(false); mPendingLockCheck = null; Loading packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java +4 −3 Original line number Diff line number Diff line Loading @@ -325,12 +325,13 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mLockPatternView.clearPattern(); mLockPatternView.setEnabled(false); final long elapsedRealtime = SystemClock.elapsedRealtime(); mCountdownTimer = new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { final long secondsInFuture = (long) Math.ceil( (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0); mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { final int secondsRemaining = (int) (millisUntilFinished / 1000); final int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0); mSecurityMessageDisplay.formatMessage( R.string.kg_too_many_failed_attempts_countdown, secondsRemaining); } Loading Loading
packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java +9 −2 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected View mEcaView; protected boolean mEnableHaptics; private boolean mDismissing; private CountDownTimer mCountdownTimer = null; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading Loading @@ -215,11 +216,13 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected void handleAttemptLockout(long elapsedRealtimeDeadline) { setPasswordEntryEnabled(false); long elapsedRealtime = SystemClock.elapsedRealtime(); new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { long secondsInFuture = (long) Math.ceil( (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0); mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { int secondsRemaining = (int) (millisUntilFinished / 1000); int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0); mSecurityMessageDisplay.formatMessage( R.string.kg_too_many_failed_attempts_countdown, secondsRemaining); } Loading Loading @@ -252,6 +255,10 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout @Override public void onPause() { if (mCountdownTimer != null) { mCountdownTimer.cancel(); mCountdownTimer = null; } if (mPendingLockCheck != null) { mPendingLockCheck.cancel(false); mPendingLockCheck = null; Loading
packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java +4 −3 Original line number Diff line number Diff line Loading @@ -325,12 +325,13 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mLockPatternView.clearPattern(); mLockPatternView.setEnabled(false); final long elapsedRealtime = SystemClock.elapsedRealtime(); mCountdownTimer = new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { final long secondsInFuture = (long) Math.ceil( (elapsedRealtimeDeadline - elapsedRealtime) / 1000.0); mCountdownTimer = new CountDownTimer(secondsInFuture * 1000, 1000) { @Override public void onTick(long millisUntilFinished) { final int secondsRemaining = (int) (millisUntilFinished / 1000); final int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0); mSecurityMessageDisplay.formatMessage( R.string.kg_too_many_failed_attempts_countdown, secondsRemaining); } Loading