diff options
author | Jim Miller <jaggies@google.com> | 2011-04-14 15:13:49 -0700 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2011-04-14 15:24:40 -0700 |
commit | da3ae8fba865e4b02016bcb65b87a1fbfa000158 (patch) | |
tree | 67318a8b629fd7fcff21393fd2d4488396e5806f /policy/src | |
parent | f60cee57f55394e015a86c51b47c82bfd61feb18 (diff) | |
download | frameworks_base-da3ae8fba865e4b02016bcb65b87a1fbfa000158.zip frameworks_base-da3ae8fba865e4b02016bcb65b87a1fbfa000158.tar.gz frameworks_base-da3ae8fba865e4b02016bcb65b87a1fbfa000158.tar.bz2 |
Use system IME for LockScreen password mode.
Change-Id: I16c4d26fd2aeac2fe1647145b70dfde9d8d26af9
Diffstat (limited to 'policy/src')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java index 5b80a93..ca56c4f 100644 --- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -28,6 +28,7 @@ import com.android.internal.widget.PasswordEntryKeyboardView; import android.os.CountDownTimer; import android.os.SystemClock; import android.telephony.TelephonyManager; +import android.text.InputType; import android.text.method.DigitsKeyListener; import android.text.method.TextKeyListener; import android.util.Log; @@ -70,6 +71,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private CountDownTimer mCountdownTimer; private StatusView mStatusView; + private final boolean mUseSystemIME = true; // TODO: Make configurable // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. @@ -108,14 +110,23 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mPasswordEntry.setOnEditorActionListener(this); mPasswordEntry.setOnClickListener(new OnClickListener() { public void onClick(View v) { - if (mIsAlpha && !isPhysicalKbShowing) { - mKeyboardViewAlpha.setVisibility( - mKeyboardViewAlpha.getVisibility() == View.VISIBLE - ? View.GONE : View.VISIBLE); - mCallback.pokeWakelock(); + if (mIsAlpha && !isPhysicalKbShowing && !mUseSystemIME) { + // Toggle visibility of alpha keyboard + final boolean visible = mKeyboardViewAlpha.getVisibility() == View.VISIBLE; + mKeyboardViewAlpha.setVisibility(visible ? View.GONE : View.VISIBLE); } + mCallback.pokeWakelock(); } }); + + // 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_TEXT_VARIATION_PASSWORD); + } + mEmergencyCallButton = (Button) findViewById(R.id.emergencyCall); mEmergencyCallButton.setOnClickListener(this); mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton); @@ -176,7 +187,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen /** {@inheritDoc} */ public boolean needsInput() { - return false; + return mUseSystemIME && mIsAlpha; } /** {@inheritDoc} */ @@ -295,7 +306,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { // Check if this was the result of hitting the enter key - if (actionId == EditorInfo.IME_NULL) { + if (actionId == EditorInfo.IME_NULL || actionId == EditorInfo.IME_ACTION_DONE) { verifyPasswordAndUnlock(); return true; } |