After understanding more clearly requirement from comment below my
answer, here is updated answer
Pass is the SDK responsible for Fingerprint feature for Samsung devices. What you can do, you can check if device is using Pass
SDK or not.
Below is code to check it:
FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
boolean isFingerprintSupported = fingerprintManager != null && fingerprintManager.isHardwareDetected();
if (!isFingerprintSupported && SsdkVendorCheck.isSamsungDevice()) { // for samsung devices which doesn't support Native Android Fingerprint API
Spass spass = new Spass();
try {
spass.initialize(context);
isFingerprintSupported = spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT);
} catch (SsdkUnsupportedException | UnsupportedOperationException e) {
//Error handling here
}
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // for devices which doesn't support Pass SDK
FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
if (!fingerprintManager.isHardwareDetected()) {
// This device is not supporting fingerprint authentication
} else if (!fingerprintManager.hasEnrolledFingerprints()) {
// User hasn't enrolled any fingerprints to authenticate with
} else {
// Everything is ready for fingerprint authentication
}
}
}
Add below permissions to AndroidManifest.xml.
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
I hope this will help.