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

Commit 7641506e authored by Jim Miller's avatar Jim Miller
Browse files

Fix wrong password attempt count in DevicePolicyManager

Keyguard wasn't resetting dpm's count when a successful password
was made.  The result is the device would get wiped earlier than
it should.

Also fixes a TODO left over from keyguard refactoring that
allowed face unlock to trigger the same logic (ouch!).

Fixes bug 7219258

Change-Id: I2bd13c50a9beb8225d3237e86d5e34b73d0eb3cf
parent 6eeff850
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -243,12 +243,16 @@ public class KeyguardHostView extends KeyguardViewBase {

        public void reportSuccessfulUnlockAttempt() {
            KeyguardUpdateMonitor.getInstance(mContext).clearFailedUnlockAttempts();
            mLockPatternUtils.reportSuccessfulPasswordAttempt();
        }

        public void reportFailedUnlockAttempt() {
            // TODO: handle biometric attempt differently.
            if (mCurrentSecuritySelection == SecurityMode.Biometric) {
                KeyguardUpdateMonitor.getInstance(mContext).reportFailedBiometricUnlockAttempt();
            } else {
                KeyguardHostView.this.reportFailedUnlockAttempt();
            }
        }

        public int getFailedAttempts() {
            return KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();