Android nougat USE_FINGERPRINT permissions

returnvoid picture returnvoid · Nov 22, 2017 · Viewed 9.3k times · Source

I'm trying to implement the fingerprint and not sure if it's an issue but on Android Nougat the permissions for the USE_FINGERPRINT is never asked. So I never get the dialog popup. I have the implementation for ACCESS_FINE_LOCATION and it works (the app ask to allow or deny).

In my manifest:

<uses-permission android:name="android.permission.USE_FINGERPRINT" />

<uses-feature
    android:name="android.hardware.fingerprint"
    android:required="false" />

In the fragment

if (ActivityCompat.checkSelfPermission(getActivity(),Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        Log.v(TAG, "NO permissions USE_FINGERPRINT");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            Log.v(TAG, "No requestPermissions");
            ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.USE_FINGERPRINT}, FingerprintHandler.FINGERPRINT_PERMISSION);
        }
        return;
    }

Answer

Ch4t4r picture Ch4t4r · Nov 22, 2017

This is normal. The Fingerprint permission is not marked as dangerous and thus you don't have to ask for access to it. It is granted automatically if you declare the permission in your manifest.

This is because you cannot access the sensor directly and all calls to it are proxied trough the FingerprintManager which is somewhat limited.

Edited March 2019: USE_FINGERPRINT is deprecated in favor of USE_BIOMETRIC, but can still be used. USE_BIOMETRIC is granted by declaring it in the manifest as well.