summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2010-03-02 17:24:48 -0800
committerJim Miller <jaggies@google.com>2010-03-02 17:24:48 -0800
commitb65d331b94b8040b08a52f0e97f9cdd8b7d031b4 (patch)
tree69961ba3dfb6d3182875a5cd7a156491f032143c
parent98625cb45fb662cb056d4cce4108d9a0fd8e5c83 (diff)
downloadbase-b65d331b94b8040b08a52f0e97f9cdd8b7d031b4.tar.gz
Fix 2481917: allows keyboards with overlapping qwerty/numeric keys to work w/o requiring hitting the <alt> key.
Some devices have a qwerty layout without separate numeric keys. This makes PIN entry painful. The workaround is to set an explicit numeric key listener when in numeric mode.
-rw-r--r--phone/com/android/internal/policy/impl/PasswordUnlockScreen.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/phone/com/android/internal/policy/impl/PasswordUnlockScreen.java b/phone/com/android/internal/policy/impl/PasswordUnlockScreen.java
index a721c47..c52ef53 100644
--- a/phone/com/android/internal/policy/impl/PasswordUnlockScreen.java
+++ b/phone/com/android/internal/policy/impl/PasswordUnlockScreen.java
@@ -23,6 +23,8 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.PasswordEntryKeyboardView;
import android.telephony.TelephonyManager;
+import android.text.method.DigitsKeyListener;
+import android.text.method.TextKeyListener;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -92,6 +94,14 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE);
mPasswordEntry.requestFocus();
+ // This allows keyboards with overlapping qwerty/numeric keys to choose just the
+ // numeric keys.
+ if (isAlpha) {
+ mPasswordEntry.setKeyListener(TextKeyListener.getInstance());
+ } else {
+ mPasswordEntry.setKeyListener(DigitsKeyListener.getInstance());
+ }
+
mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ?
com.android.internal.R.array.config_virtualKeyVibePattern : 0);