diff options
| author | 2015-08-27 02:44:18 +0000 | |
|---|---|---|
| committer | 2015-08-27 02:44:18 +0000 | |
| commit | dfb8cca04dd64dcdf1df4550f7e808360de0517d (patch) | |
| tree | 76f91b84db466b91946653f490300bad1795c02a | |
| parent | 9dbc35d10be3ac3a446e00c39d6604024e228f10 (diff) | |
| parent | ed7dcc2dc593e7b75340df2b22cb4b07cce351eb (diff) | |
Merge "Don't check the keyguard PIN a second time" into mnc-dr-dev
| -rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java | 5 | ||||
| -rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java | 5 | 
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java index dfc31ab44aec..b03871a4a50e 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java @@ -40,6 +40,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout      protected SecurityMessageDisplay mSecurityMessageDisplay;      protected View mEcaView;      protected boolean mEnableHaptics; +    private boolean mDismissing;      // 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. @@ -67,6 +68,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout      @Override      public void reset() {          // start fresh +        mDismissing = false;          resetPasswordText(false /* animate */);          // if the user is currently locked out, enforce it.          long deadline = mLockPatternUtils.getLockoutAttemptDeadline( @@ -113,6 +115,8 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout      }      protected void verifyPasswordAndUnlock() { +        if (mDismissing) return; // already verified but haven't been dismissed; don't do it again. +          final String entry = getPasswordText();          setPasswordEntryInputEnabled(false);          if (mPendingLockCheck != null) { @@ -143,6 +147,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout      private void onPasswordChecked(boolean matched, int timeoutMs, boolean isValidPassword) {          if (matched) { +            mDismissing = true;              mCallback.reportUnlockAttempt(true, 0);              mCallback.dismiss(true);          } else { diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java index 4cd4845f3278..ce2d11aeccf7 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPinBasedInputView.java @@ -62,6 +62,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView          return mPasswordEntry.requestFocus(direction, previouslyFocusedRect);      } +    @Override      protected void resetState() {          mPasswordEntry.setEnabled(true);      } @@ -69,11 +70,13 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView      @Override      protected void setPasswordEntryEnabled(boolean enabled) {          mPasswordEntry.setEnabled(enabled); +        mOkButton.setEnabled(enabled);      }      @Override      protected void setPasswordEntryInputEnabled(boolean enabled) {          mPasswordEntry.setEnabled(enabled); +        mOkButton.setEnabled(enabled);      }      @Override @@ -186,6 +189,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView          mDeleteButton = findViewById(R.id.delete_button);          mDeleteButton.setVisibility(View.VISIBLE);          mDeleteButton.setOnClickListener(new OnClickListener() { +            @Override              public void onClick(View v) {                  // check for time-based lockouts                  if (mPasswordEntry.isEnabled()) { @@ -195,6 +199,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView              }          });          mDeleteButton.setOnLongClickListener(new View.OnLongClickListener() { +            @Override              public boolean onLongClick(View v) {                  // check for time-based lockouts                  if (mPasswordEntry.isEnabled()) {  |