summaryrefslogtreecommitdiffstats
path: root/policy/com
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
commit8b9dda28c9850b4a68b6958b8d4f751dd64157ad (patch)
tree58e0c9b333772497890f420b79f3df3fd925af13 /policy/com
parent98f182f78e7dc76039cff4cfe26237e0d9350563 (diff)
downloadframeworks_base-8b9dda28c9850b4a68b6958b8d4f751dd64157ad.zip
frameworks_base-8b9dda28c9850b4a68b6958b8d4f751dd64157ad.tar.gz
frameworks_base-8b9dda28c9850b4a68b6958b8d4f751dd64157ad.tar.bz2
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.
Diffstat (limited to 'policy/com')
-rw-r--r--policy/com/android/internal/policy/impl/PasswordUnlockScreen.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java
index a721c47..c52ef53 100644
--- a/policy/com/android/internal/policy/impl/PasswordUnlockScreen.java
+++ b/policy/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);