diff options
Diffstat (limited to 'policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/FingerUnlockScreen.java | 50 |
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)); |