Finally solved. It looks like android default API is not able to handle some Samsung devices, so the solution is to add the Samsung libraries for this issue.
You can find some documentation and the libraries here: http://developer.samsung.com/galaxy/pass
After add the libraries, you have to add a new permission to your manifest:
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
And finally, you could use this method:
private boolean isFingerprintSupported() {
boolean isFingerprintSupported = fingerprintManager != null && fingerprintManager.isHardwareDetected();
if (!isFingerprintSupported && SsdkVendorCheck.isSamsungDevice()) {
Spass spass = new Spass();
try {
spass.initialize(context);
isFingerprintSupported = spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT);
} catch (SsdkUnsupportedException | UnsupportedOperationException e) {
// Error handling
}
}
return isFingerprintSupported;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…