How to check device compatibility for Iris Scan authentication in android

1k Views Asked by At

I am working with Samsung tab Iris scan feature. My requirement is, if current device is supports Iris hardware, then I will go through Iris scan else will use normal way in the application.

So, any one can tell me, how to check device compatibility for Iris Scan hardware in android.

Thanks in advance.

2

There are 2 best solutions below

0
On

I was able to check if my Samsung device was capable of Samsung Face or Samsung Iris by checking for the presence of the following packages on the device using the Android PackageManager class: com.samsung.android.bio.face.service or com.samsung.android.server.iris

Example usage:

For face:

PackageInfo faceSamsung = packageManager.getPackageInfo("com.samsung.android.bio.face.service", PackageManager.GET_META_DATA);

For iris:

PackageInfo irisSamsung = packageManager.getPackageInfo("com.samsung.android.server.iris", PackageManager.GET_META_DATA);

An exception is thrown if the package and feature is not present on the device.

Two caveats:

  • This does not guarantee the biometrics is actually setup and in use. It only displays the presence of the feature. The BiometricManager class could be used in conjunction to confirm enrollment.

  • There does not appear to be a way to pick and choose from within an app which biometric methods are used. There is the deprecated FingerprintManager functionality that can get fingerprint verification or the new BiometricPrompt features but the biometric authentication presents the OS level prompt which is determined by the biometric auth preferences the user chose in the settings app. If multiple biometric authentication methods are setup this can show as a choice to the user, but it is in the OS dialog outside of the control of your app.

1
On

It may be too late for an answer, but try to use:

val packageManager: PackageManager = context.packageManager
if(packageManager.hasSystemFeature(PackageManager.FEATURE_IRIS)) {
// do something
}