diff options
| author | 2011-07-08 19:15:51 -0700 | |
|---|---|---|
| committer | 2011-07-08 19:15:51 -0700 | |
| commit | 8ecfac1d8c2988c3d5031e78f9edefff6e663fd1 (patch) | |
| tree | 01a31f4cb6c323898e47e3be7532758c3ec67226 | |
| parent | b7440a140b650932bf31cf51d3b87c3249e3b682 (diff) | |
Fix 4942542, 4590542: Password unlock fixes
Fixes issue where hint text was inappropriately shown on password unlock screen.
This was caused by TextView.setKeyListener() clearing the inputType flags. The
workaround is to change the order of these calls. TextView.setKeyListener()
should probably not be clearing existing inputType flags.
Fixes wake issue caused by IME events not poking the wakelock. It now correctly pokes
the wakelock whenever the password text field changes.
Change-Id: I746b21117492c4a176f6627e7d33150e6104495e
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java index f862d01e3ecb..75e799c2fe81 100644 --- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -29,7 +29,9 @@ import android.os.CountDownTimer; import android.os.SystemClock; import android.security.KeyStore; import android.telephony.TelephonyManager; +import android.text.Editable; import android.text.InputType; +import android.text.TextWatcher; import android.text.method.DigitsKeyListener; import android.text.method.TextKeyListener; import android.util.Log; @@ -120,15 +122,6 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen } }); - // We don't currently use the IME for PIN mode, but this will make it work if we ever do... - if (!mIsAlpha) { - mPasswordEntry.setInputType(InputType.TYPE_CLASS_NUMBER - | InputType.TYPE_NUMBER_VARIATION_PASSWORD); - } else { - mPasswordEntry.setInputType(InputType.TYPE_CLASS_TEXT - | InputType.TYPE_TEXT_VARIATION_PASSWORD); - } - mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton); mEmergencyCallButton.setOnClickListener(this); mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton); @@ -151,14 +144,17 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mPasswordEntry.requestFocus(); - // This allows keyboards with overlapping qwerty/numeric keys to choose just the - // numeric keys. + // This allows keyboards with overlapping qwerty/numeric keys to choose just numeric keys. if (mIsAlpha) { mPasswordEntry.setKeyListener(TextKeyListener.getInstance()); + mPasswordEntry.setInputType(InputType.TYPE_CLASS_TEXT + | InputType.TYPE_TEXT_VARIATION_PASSWORD); // mStatusView.setHelpMessage(R.string.keyguard_password_enter_password_code, // StatusView.LOCK_ICON); } else { mPasswordEntry.setKeyListener(DigitsKeyListener.getInstance()); + mPasswordEntry.setInputType(InputType.TYPE_CLASS_NUMBER + | InputType.TYPE_NUMBER_VARIATION_PASSWORD); //mStatusView.setHelpMessage(R.string.keyguard_password_enter_pin_code, // StatusView.LOCK_ICON); } @@ -179,6 +175,19 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen //mUpdateMonitor.registerSimStateCallback(this); resetStatusInfo(); + + // Poke the wakelock any time the text is modified + mPasswordEntry.addTextChangedListener(new TextWatcher() { + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + public void afterTextChanged(Editable s) { + mCallback.pokeWakelock(); + } + }); } @Override |