Reputation: 2530
I don't see anything related to being able to distinguish between different biometric authentications within the android.hardware.biometrics
package.
I have found the FingerprintManagerCompat
that has the hasEnrolledFingerprints()
methods but I was wondering if it was the way to go as it seems from the documentation that we should rely on the android.hardware.biometrics
package classes.
Any advice on that? Did I miss something?
Upvotes: 6
Views: 6695
Reputation: 1
This is by far, not a future-proof piece of code, but it might just get you out of the problem you're in. This may be what you need.
Upvotes: 0
Reputation: 2180
As of now we ideally cannot. Look into this : https://issuetracker.google.com/issues/111315641
Upvotes: 3
Reputation: 1326
Use Android Biomatric Api
use the below method to identify Biomatric available or not
public int canAuthenticate () // api introduced android 29
Upvotes: -2
Reputation: 207
hasEnrolledFingerprints
was depreceated in API 28.
It is now suggested to use BiometricPrompt and BiometricManager instead of FingerprintManagerCompat
. This class allows for a seamless biometric UI across the device and allows for any kind of Biometric authentication provided by the OEM.
Where you might have called hasEnrolledFingerprints
in the past to see if the user has fingerprints set up, the BiometricPrompt will throw an error specific to this.
Upvotes: 0