summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Kramskikh <vkramskikh@gmail.com>2012-03-02 15:31:16 +0400
committerVitaly Kramskikh <vkramskikh@gmail.com>2012-03-03 16:04:06 +0400
commitea88026fcb7aa405ebde0d38447d716b38b66971 (patch)
tree7acaf6b35793c08a5858e3523b16a039e8fe3c55
parentc9a82b44209001856b8b2cb633945006f6d55503 (diff)
downloadframeworks_base-ea88026fcb7aa405ebde0d38447d716b38b66971.zip
frameworks_base-ea88026fcb7aa405ebde0d38447d716b38b66971.tar.gz
frameworks_base-ea88026fcb7aa405ebde0d38447d716b38b66971.tar.bz2
policy: do not count invalid fingerprint swipes as bad tries
Change-Id: I8179aadaf78a3d492524c9aeadce09b32ae992b6
-rw-r--r--policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java50
1 files changed, 17 insertions, 33 deletions
diff --git a/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java b/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java
index d658280..43ec578 100644
--- a/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java
+++ b/policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java
@@ -167,7 +167,7 @@ class FingerUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
static Thread mExecutionThread = null;
private Thread mUiThread;
- private boolean mbFeedbackDelivered = false;
+ private boolean mbInvalidSwipe = false;
private VerifyRunner mVerifyRunner = new VerifyRunner();
private Context m_Context;
@@ -1117,11 +1117,11 @@ class FingerUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
/* we've already displayed the feedback, so we don't want to worry */
/* about an additional message. */
if (target.equals("swipe_bad")) {
- // Update the total failed attempts.
- mTotalFailedPatternAttempts++;
- mFailedPatternAttemptsSinceLastTimeout++;
+ if (!mbInvalidSwipe) {
+ // Update the total failed attempts.
+ mTotalFailedPatternAttempts++;
+ mFailedPatternAttemptsSinceLastTimeout++;
- if (!mbFeedbackDelivered) {
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_not_match));
@@ -1135,71 +1135,55 @@ class FingerUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
}
});
} else {
- runOnUiThread(new Runnable() {
- public void run() {
- mCallback.reportFailedUnlockAttempt();
- if (mFailedPatternAttemptsSinceLastTimeout >=
- LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
- pokeWakelock(1000);
- long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
- handleAttemptLockout(deadline);
- }
- }
- });
+ mbInvalidSwipe = false;
}
- mbFeedbackDelivered = false;
return;
}
/* if the target is any of our feedback messages, provide a toast... */
if (target.equals("swipe_too_fast")) {
- mbFeedbackDelivered = true;
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_fast));
}
});
return;
- }
- if (target.equals("swipe_too_slow")) {
- mbFeedbackDelivered = true;
+ } else if (target.equals("swipe_too_slow")) {
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_slow));
}
});
return;
- }
- if (target.equals("swipe_too_short")) {
- mbFeedbackDelivered = true;
+ } else if (target.equals("swipe_too_short")) {
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_short));
}
});
return;
- }
- if (target.equals("swipe_too_skewed")) {
- mbFeedbackDelivered = true;
+ } else if (target.equals("swipe_too_skewed")) {
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_skewed));
}
});
return;
- }
- if (target.equals("swipe_too_far_left")) {
- mbFeedbackDelivered = true;
+ } else if (target.equals("swipe_too_far_left")) {
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_far_left));
}
});
return;
- }
- if (target.equals("swipe_too_far_right")) {
- mbFeedbackDelivered = true;
+ } else if (target.equals("swipe_too_far_right")) {
+ mbInvalidSwipe = true;
runOnUiThread(new Runnable() {
public void run() {
toast(getContext().getString(R.string.keyguard_finger_swipe_too_far_right));