summaryrefslogtreecommitdiffstats
path: root/packages/Keyguard
diff options
context:
space:
mode:
authorXiyuan Xia <xiyuan@google.com>2015-05-19 15:00:41 -0700
committerXiyuan Xia <xiyuan@google.com>2015-05-21 01:39:08 +0000
commitde26ea65a8ca248907688f5b73f6b43f07e0c2d8 (patch)
treefe5282cb649e57b207c9a8fcf76c3a63451366e6 /packages/Keyguard
parent8e9d7d55053094f5cc9ab8bcd5a0a9803ec40dfe (diff)
downloadframeworks_base-de26ea65a8ca248907688f5b73f6b43f07e0c2d8.zip
frameworks_base-de26ea65a8ca248907688f5b73f6b43f07e0c2d8.tar.gz
frameworks_base-de26ea65a8ca248907688f5b73f6b43f07e0c2d8.tar.bz2
Do not show soft keyboard when locked out on keyguard UI
- Split password entry enabled and input enabled into two states; - Disable input during lock check; - Disable password entry when locked out; - Don't show soft keyboard if password entry is disabled on resume; - Auto show soft keyboard when password entry becomes enabled; Bug:20542149 Change-Id: Iffe3f205776143ac21e25e337d5b7a0e6994ebf2
Diffstat (limited to 'packages/Keyguard')
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java5
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java12
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java5
3 files changed, 19 insertions, 3 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index 54bbd5a..6295de4 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -110,7 +110,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
protected void verifyPasswordAndUnlock() {
final String entry = getPasswordText();
- setPasswordEntryEnabled(false);
+ setPasswordEntryInputEnabled(false);
if (mPendingLockCheck != null) {
mPendingLockCheck.cancel(false);
}
@@ -121,7 +121,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
new LockPatternChecker.OnCheckCallback() {
@Override
public void onChecked(boolean matched) {
- setPasswordEntryEnabled(true);
+ setPasswordEntryInputEnabled(true);
mPendingLockCheck = null;
onPasswordChecked(entry, matched);
}
@@ -152,6 +152,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
protected abstract void resetPasswordText(boolean animate);
protected abstract String getPasswordText();
protected abstract void setPasswordEntryEnabled(boolean enabled);
+ protected abstract void setPasswordEntryInputEnabled(boolean enabled);
// Prevent user from using the PIN/Password entry until scheduled deadline.
protected void handleAttemptLockout(long elapsedRealtimeDeadline) {
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
index f18c451..c9ad728 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPasswordView.java
@@ -74,7 +74,12 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
protected void resetState() {
mSecurityMessageDisplay.setMessage(R.string.kg_password_instructions, false);
+ final boolean wasDisabled = mPasswordEntry.isEnabled();
setPasswordEntryEnabled(true);
+ setPasswordEntryInputEnabled(true);
+ if (wasDisabled) {
+ mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
+ }
}
@Override
@@ -95,7 +100,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
post(new Runnable() {
@Override
public void run() {
- if (isShown()) {
+ if (isShown() && mPasswordEntry.isEnabled()) {
mPasswordEntry.requestFocus();
if (reason != KeyguardSecurityView.SCREEN_ON || mShowImeAtScreenOn) {
mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
@@ -190,6 +195,11 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView
@Override
protected void setPasswordEntryEnabled(boolean enabled) {
+ mPasswordEntry.setEnabled(enabled);
+ }
+
+ @Override
+ protected void setPasswordEntryInputEnabled(boolean enabled) {
mPasswordEntryDisabler.setInputEnabled(enabled);
}
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java
index 84b4cf8..ed0d4af 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -72,6 +72,11 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView
}
@Override
+ protected void setPasswordEntryInputEnabled(boolean enabled) {
+ mPasswordEntry.setEnabled(enabled);
+ }
+
+ @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (KeyEvent.isConfirmKey(keyCode)) {
performClick(mOkButton);