Skip to content

Commit 7641506

Browse files
author
Jim Miller
committed
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
1 parent 6eeff85 commit 7641506

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,15 @@ public boolean isVerifyUnlockOnly() {
243243

244244
public void reportSuccessfulUnlockAttempt() {
245245
KeyguardUpdateMonitor.getInstance(mContext).clearFailedUnlockAttempts();
246+
mLockPatternUtils.reportSuccessfulPasswordAttempt();
246247
}
247248

248249
public void reportFailedUnlockAttempt() {
249-
// TODO: handle biometric attempt differently.
250-
KeyguardHostView.this.reportFailedUnlockAttempt();
250+
if (mCurrentSecuritySelection == SecurityMode.Biometric) {
251+
KeyguardUpdateMonitor.getInstance(mContext).reportFailedBiometricUnlockAttempt();
252+
} else {
253+
KeyguardHostView.this.reportFailedUnlockAttempt();
254+
}
251255
}
252256

253257
public int getFailedAttempts() {

0 commit comments

Comments
 (0)