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

Commit 1625e87e authored by Danielle Millett's avatar Danielle Millett
Browse files

Showing message when max attempts are hit in face unlock fixes b/7306168

Added a check in pattern and PIN to showed the face unlock max attempts
failure message if that had been reached.  The max attempts can only
be true if face unlock is enabled so it doesn't need to also check if it's
enabled.

Change-Id: If8a26498961d79fa6a647abc923c72f0af407e61
parent 6e36f101
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -42,7 +42,11 @@ public class KeyguardPINView extends KeyguardAbsKeyInputView
    }

    protected void resetState() {
        if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
            mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
        } else {
            mSecurityMessageDisplay.setMessage(R.string.kg_pin_instructions, false);
        }
        mPasswordEntry.setEnabled(true);
    }

+10 −2
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        if (deadline != 0) {
            handleAttemptLockout(deadline);
        } else {
            mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
            displayDefaultSecurityMessage();
        }

        // the footer depends on how many total attempts the user has failed
@@ -197,6 +197,14 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit

    }

    private void displayDefaultSecurityMessage() {
        if (KeyguardUpdateMonitor.getInstance(mContext).getMaxBiometricUnlockAttemptsReached()) {
            mSecurityMessageDisplay.setMessage(R.string.faceunlock_multiple_failures, true);
        } else {
            mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
        }
    }

    @Override
    public void showUsabilityHint() {
    }
@@ -338,7 +346,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
            @Override
            public void onFinish() {
                mLockPatternView.setEnabled(true);
                mSecurityMessageDisplay.setMessage(R.string.kg_pattern_instructions, false);
                displayDefaultSecurityMessage();
                // TODO mUnlockIcon.setVisibility(View.VISIBLE);
                mFailedPatternAttemptsSinceLastTimeout = 0;
                if (mEnableFallback) {