Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b9dda28 authored by Jim Miller's avatar Jim Miller
Browse files

Fix 2481917: allows keyboards with overlapping qwerty/numeric keys to work w/o...

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.
parent 98f182f7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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);