summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-03-03 22:21:20 +0300
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-03-03 22:21:20 +0300
commit4d2c5ca8a3598b37ddb202844e5e9d2bcb5f3b1b (patch)
tree5ba8f5cc4caad8c90fff1cceaa94453ecc40f8c3
parent7e17a5929c03de54d4e931aab440581c1bedd74b (diff)
parentea88026fcb7aa405ebde0d38447d716b38b66971 (diff)
downloadframeworks_base-4d2c5ca8a3598b37ddb202844e5e9d2bcb5f3b1b.zip
frameworks_base-4d2c5ca8a3598b37ddb202844e5e9d2bcb5f3b1b.tar.gz
frameworks_base-4d2c5ca8a3598b37ddb202844e5e9d2bcb5f3b1b.tar.bz2
Merge "policy: do not count invalid fingerprint swipes as bad tries" into gingerbread
-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));