Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0340b429 authored by Jim Miller's avatar Jim Miller
Browse files

Fix 2420689: Fix bug that prevents pattern unlock from showing lockout dialog.

This fixes the problem where the lockout dialog wasn't showing.  It also fixes a problem
where the "forgot pattern" button would stop working.
parent c20115c5
Loading
Loading
Loading
Loading
+3 −13
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase
                // irrelevant to keyguard screen, they shouldn't be calling this
            }

            public void reportFailedPatternAttempt() {
            public void reportFailedUnlockAttempt() {
                mUpdateMonitor.reportFailedAttempt();
                final int failedAttempts = mUpdateMonitor.getFailedAttempts();
                if (DEBUG) Log.d(TAG,
@@ -308,16 +308,13 @@ public class LockPatternKeyguardView extends KeyguardViewBase
                        == 0) {
                    showTimeoutDialog();
                }
                mLockPatternUtils.reportFailedPasswordAttempt();
            }

            public boolean doesFallbackUnlockScreenExist() {
                return mEnableFallback;
            }

            public void reportFailedUnlockAttempt() {
                mLockPatternUtils.reportFailedPasswordAttempt();
            }

            public void reportSuccessfulUnlockAttempt() {
                mLockPatternUtils.reportSuccessfulPasswordAttempt();
            }
@@ -330,13 +327,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase
        setFocusableInTouchMode(true);
        setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);

        // wall paper background
        if (false) {
            final BitmapDrawable drawable = (BitmapDrawable) context.getWallpaper();
            setBackgroundDrawable(
                    new FastBitmapDrawable(drawable.getBitmap()));
        }

        // create both the lock and unlock screen so they are quickly available
        // when the screen turns on
        mLockScreen = createLockScreen();
@@ -680,7 +670,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase
                    break;
                case LockPatternUtils.MODE_PATTERN:
                    // "forgot pattern" button is only available in the pattern mode...
                    if (mForgotPattern && mLockPatternUtils.isPermanentlyLocked()) {
                    if (mForgotPattern || mLockPatternUtils.isPermanentlyLocked()) {
                        currentMode = UnlockMode.Account;
                    } else {
                        currentMode = UnlockMode.Pattern;
+1 −8
Original line number Diff line number Diff line
@@ -62,11 +62,6 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
    // how many cells the user has to cross before we poke the wakelock
    private static final int MIN_PATTERN_BEFORE_POKE_WAKELOCK = 2;

    // This dictates how long a pattern should be before we count it as an attempt.
    // This should be long enough to avoid false triggers while the device is in a pocket,
    // as this can lead to a wiped device if a {@link DeviceAdmin} is active and has it enabled.
    private static final int MIN_PATTERN_BEFORE_REPORT = 3;

    private int mFailedPatternAttemptsSinceLastTimeout = 0;
    private int mTotalFailedPatternAttempts = 0;
    private CountDownTimer mCountdownTimer = null;
@@ -511,6 +506,7 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
                if (pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
                    mTotalFailedPatternAttempts++;
                    mFailedPatternAttemptsSinceLastTimeout++;
                    mCallback.reportFailedUnlockAttempt();
                }
                if (mFailedPatternAttemptsSinceLastTimeout >= LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) {
                    long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
@@ -523,9 +519,6 @@ class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient
                            mCancelPatternRunnable,
                            PATTERN_CLEAR_TIMEOUT_MS);
                }
                if (pattern.size() > MIN_PATTERN_BEFORE_REPORT) {
                    mCallback.reportFailedUnlockAttempt();
                }
            }
        }
    }