summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svetoslav Ganov <svetoslavganov@google.com> 2012-10-23 17:35:17 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-10-23 17:35:24 -0700
commite1655c980d28b953597727d2c7832b442ca926cc (patch)
treeea3d58b43cc6accf3db6cb3da1d4c73bbc66ceb6
parentda2509c434ebb2a5a0da1bc270cae7f007cbb0f9 (diff)
parentc2798a916e470a7ee9ecc5ffcf1dc1d7a46f9410 (diff)
Merge "When A11y is on, use a longer interval between lockout announcements." into jb-mr1-dev
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
index 1868507e80ba..be2dc8ffb28e 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java
@@ -38,6 +38,7 @@ import android.text.TextWatcher;
import android.text.method.DigitsKeyListener;
import android.text.method.TextKeyListener;
import android.view.KeyEvent;
+import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
@@ -55,6 +56,16 @@ import com.android.internal.widget.PasswordEntryKeyboardHelper;
public class KeyguardPasswordView extends LinearLayout
implements KeyguardSecurityView, OnEditorActionListener, TextWatcher {
+ /** Delay in ms between updates to the "too many attempts" count down. */
+ private static final long LOCKOUT_INTERVAL = 1000;
+
+ /**
+ * Delay in ms between updates to the "too many attempts" count down used
+ * when accessibility is turned on. Less annoying than the shorter default
+ * {@link #LOCKOUT_INTERVAL}.
+ */
+ private static final long ACCESSIBILITY_LOCKOUT_INTERVAL = 10000;
+
private KeyguardSecurityCallback mCallback;
private EditText mPasswordEntry;
private LockPatternUtils mLockPatternUtils;
@@ -310,7 +321,12 @@ public class KeyguardPasswordView extends LinearLayout
mPasswordEntry.setEnabled(false);
mKeyboardView.setEnabled(false);
long elapsedRealtime = SystemClock.elapsedRealtime();
- new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) {
+ final AccessibilityManager accessManager =
+ (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
+ // Use a longer update interval when accessibility is turned on.
+ final long interval = accessManager.isEnabled() ? ACCESSIBILITY_LOCKOUT_INTERVAL
+ : LOCKOUT_INTERVAL;
+ new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, interval) {
@Override
public void onTick(long millisUntilFinished) {