Reputation: 111
Android 6.0 above, not using Samsung library. Using android-google biometric library, when user hit maximum attempts it will throw FINGERPRINT_ERROR_LOCKOUT.
I know that after 30seconds user is allow to try login using biometrics again, but I want to know is there any way I can do to avoid waiting 30 seconds? As in I can manually reset it so that user can try login using biometric again without waiting the 30 seconds countdown.
I have searched on internet, most of the solution is wait until 30 seconds finished then let user to try biometric login again.
For start listening, I call mFingerprintManager.authenticate(), for cancelling I call mCancellationSignal.cancel(), it doesn't work if its status is still under FINGERPRINT_ERROR_LOCKOUT (30seconds wait time), I want to know what way I can bypass and reset so I do not have to wait for 30 seconds.
Upvotes: 1
Views: 2271
Reputation: 168
You can either wait for the user to enter their password on lockscreen, or you can use the BiometricPrompt#setDeviceCredentialAllowed
API to request pin/pattern/password.
The Android Framework resets lockout when a valid pin/pattern/password is entered.
The API is available on the framework Q and older, but is available on the androidx.biometric
library for all APIs where lockscreen/biometric is supported.
The deprecated method for requesting device credentials is KeyguardManager#createConfirmDeviceCredentialIntent()
, checking for RESULT_OK
in startActivityForResult
Upvotes: 0
Reputation: 200030
No, you can't override the countdown - this is a requirement mandated by the Android Compatibility Definition Document, specifically, section 7.3.10.1 C-1-5:
- [C-1-5] MUST rate limit attempts for at least 30 seconds after five false trials for fingerprint verification.
Upvotes: 4