Search code examples
javaandroidfingerprintandroid-fingerprint-api

Android fingerprint cancellationSignal FINGERPRINT_ACQUIRED_TOO_FAST


What I do:

I am using the following tutorial to grasp the basic understanding on how to use fingerprint authentication in Android: http://joerichard.net/android/android-fingerprint-example/

I basically follow it except that I added a button and I want to authenticate a user when the button is clicked.

So I have the following changes

        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button btn = (Button) findViewById(R.id.button);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                authentication();
            }
        });

        ...

        protected void authentication(/* Bundle savedInstanceState */) {
        //super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);

        ...

My problem:

When I click the button the following notification is called (in "FingerprintHandler.java"):

                Toast.makeText(appContext,
                "Authentication error\n" + errString ,
                Toast.LENGTH_LONG).show();

The errString is Fingerprint operation canceled. and the Error message ID is 5.

By searching I found here that it correspond to FINGERPRINT_ACQUIRED_TOO_FAST, however I don't understand why this happen.

What I tried:

  • I tried to click the button while having my finger on the scanner but the notification is immediate which make me believe that it does not even listen/scan for a fingerprint.

  • I have also tried to make it work without the button but in that case nothing happens.

If you see what could go wrong or have directions in which I could investigate let me know.

Thank you.


Solution

  • My sensor was not working very well. It takes many tries to have a reading (and some time it does not work at all). Thus I would re-try by clicking on the button causing the error.

    The function would not have any reading from the scanner when clicked again the button and give the error FINGERPRINT_ACQUIRED_TOO_FAST.

    The fact that this specific error (TOO_FAST) is trigger didn't help me in my situation because as I explained this error message is trigger when clicking the button.

    If anyone encounter the same problem give more time/chances to your sensor to recognize that a finger is being read.