In my project, we're adding this biometric authentication feature using BiometricPrompt. The biometric can be enabled in the app's settings but the app also needs to display if face biometric is supported on the user's device.
Based on my research, the official way of checking if an android device has face biometric is through this code below:
val hasFaceBiometric = packageManager.hasSystemFeature(PackageManager.FEATURE_FACE)
However, this check seems to be unreliable as it only returns true on Google Pixel 4. I tested our app on Samsung Galaxy S9 and S10 and they both seem to support face biometric but the weird thing is, the code above returns false.
With the current state of face biometric in android, is there really a reliable way to check face biometric support?
The face recognition from Samsung is using the front camera which is not considered a secure biometric. This is what the docs say:
Feature for getSystemAvailableFeatures and hasSystemFeature: The device has biometric hardware to perform face authentication.
What I'm assuming is this will check if the device has secure face recognition, which the Pixel 4 has. From Android 10 and up (Pie had an issue which somewhat enabled unsecure biometrics in the API) Samsung will never show the BiometricPrompt for face recognition. If they provide a secure face recognition in a future device this check will probably return true.