0

When I get this error code FINGERPRINT_ERROR_LOCKOUT I must wait 30 seconds to retry again but after 30 seconds when trying to put my finger again nothing will happen why? And can I cancel FingerprintManager.AuthenticationCallback after authenticating? Because I want to re-authenticate after getting the error code above.

Code

FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(FINGERPRINT_SERVICE);
FingerprintManager.AuthenticationCallback authenticationCallback = new FingerprintManager.AuthenticationCallback() {
    @Override
    public void onAuthenticationError(int errorCode, CharSequence errString) {
        super.onAuthenticationError(errorCode, errString);
        Log.w("ABC", "101 - " + errorCode + " - " + errString);
    }

    @Override
    public void onAuthenticationFailed() {
        super.onAuthenticationFailed();
        Log.w("ABC", "102");
    }

    @Override
    public void onAuthenticationHelp(int helpCode, CharSequence helpString) {
        super.onAuthenticationHelp(helpCode, helpString);
        Log.w("ABC", "103 - " + helpCode + " - " + helpString);
    }

    @Override
    public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
        super.onAuthenticationSucceeded(result);
        Log.w("ABC", "104");
    }
};
fingerprintManager.authenticate(null, null, 0, authenticationCallback, null);

Any solutions?

Taha Sami
  • 1,565
  • 1
  • 16
  • 43
  • 1
    Note that if you receive `onAuthenticationError` then no further calls will be made to that `AuthenticationCallback` instance. Have you tried making another `authenticate` call after 30 seconds? – Michael Sep 15 '21 at 13:49
  • @Michael I thought if I receive any error on `onAuthenticationError` the `AuthenticationCallback` will still working but I was wrong, I knew that now from you, Thanks for the information, But it's so weird because Google doesn't talk about that in their documentation. – Taha Sami Sep 15 '21 at 14:08
  • @Michael No, I did not try to make another `authenticate` after 30 seconds and I'll try now but is there any way to know which time is left before try again or should I create it by myself and compare it using `System.currentTimeMillis()`? – Taha Sami Sep 15 '21 at 14:09
  • 1
    _"Google doesn't talk about that in their documentation"_. It's mentioned [here](https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager.AuthenticationCallback#onAuthenticationError(int,%20java.lang.CharSequence)). As far as the 30 seconds go, you'll probably have to keep track of them yourself. – Michael Sep 15 '21 at 14:11
  • @Michael Nice, Sorry Google because I wronged you :), Now everything is clear for me but about my previous comment, Is it a good way to use `System.currentTimeMillis()` to know which time is left before the next trying or there is a better method? – Taha Sami Sep 15 '21 at 14:17

0 Answers0