Suppose I have an application which uses fingerprints to authenticate users. On Android 5 I used the Samsung Spass library only for Samsung devices. With Android M release I add support to many devices. First of all I check if I'm Android M, then if I have a manager instance, if I have a hardware and if I have enrolled fingerprints:
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
FingerprintManager manager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
if (manager != null) {
logger.info("Android native fingerprint manager exists");
if (manager.isHardwareDetected()) {
logger.info("Android native fingerprint manager detected hardware");
if (manager.hasEnrolledFingerprints()) {
logger.info("Android native fingerprint manager has enrolled fingerprints");
}
}
return new AndroidFingerprintHelper(context);
}
}
If I fail here I fallback to check if Android is Samsung and it has Spass library installed. Now the question is: if a user had Lollipop on Samsung with Spass and has enrolled fingerprints. After that he upgraded to Android M without enrolling new fingerprints. Will manager.hasEnrolledFingerprints()
return true? In other words, does Samsung Spass library share its data with Android OS? Thanks.
Well after a lot of research and tests I've found out that:
On Samsung with Android M FingerPrintManager
will never null
, but if the fingerprints were registered using Spass Library (Samsung Native SDK), trying to call manager.isHardwareDetected()
will return false for Native Android FingerPrint Manager.