I have an app which has a service that can be launch when the device is locked, and this service is launching an activity of my app (even with the device locked). In this activity, I'm using the Google Fingerprint API in order to identify the user. I've tested in two devices with Android 6.0.1 (Samsung Galaxy S6 and Google LG Nexus 5X) with different results:
- Samsung Galaxy S6: Getting error 5 or FINGERRINT_ERROR_CANCELED (https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager.html#FINGERPRINT_ERROR_CANCELED) in method onAuthenticationError of AuthenticationCallback
- Nexus 5X: No error obtained, but no authentication can be performed. No matter what the users do (using a different finger, releasing the finger too fast...), no error is launched. Users can only cancel the dialog.
My questions are:
- Does anybody know why these behavoir differences?
- Does anybody know if we can use this authentication method with the device locked?
Same service/activity/authentication workflow is working perfectly when both devices are unlocked and also when the app is in either background/foreground.
Thanks!
Introducing a delay of 1 second (with handler.postDelayed) before calling authenticate method, worked for me