AnxGotta
AnxGotta

Reputation: 1004

FingerprintManagerCompat method had issues with Samsung devices

Problem

java.lang.SecurityException: Permission Denial: getCurrentUser() from pid=#####, uid=##### requires android.permission.INTERACT_ACROSS_USERS
    at android.os.Parcel.readException(Parcel.java:1620)
    at android.os.Parcel.readException(Parcel.java:1573)
    at android.hardware.fingerprint.IFingerprintService$Stub$Proxy.hasEnrolledFingerprints(IFingerprintService.java:503)
    at android.hardware.fingerprint.FingerprintManager.hasEnrolledFingerprints(FingerprintManager.java:768)
    at android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23.hasEnrolledFingerprints(FingerprintManagerCompatApi23.java:39)
    at android.support.v4.hardware.fingerprint.FingerprintManagerCompat$Api23FingerprintManagerCompatImpl.hasEnrolledFingerprints(FingerprintManagerCompat.java:239)
    at android.support.v4.hardware.fingerprint.FingerprintManagerCompat.hasEnrolledFingerprints(FingerprintManagerCompat.java:66)

This issue has only occurred on some Samsung devices:

(data from crash reports)


Current solution from research

After researching the issue, the only solution I've found is to add the following permission to the manifest:

<permission
    android:name="android.permission.INTERACT_ACROSS_USERS_FULL"
    android:protectionLevel="signature"/>

This seems odd and I'm not sure if this is the best or proper solution.


Question

Why is this exception being thrown? Is the above solution correct?

I would really like more information on this.

Thanks!

Upvotes: 10

Views: 1773

Answers (2)

Wirling
Wirling

Reputation: 5375

Finally I found a way to reproduce this issue. First you need to register a fingerprint on the device and set the lockscreen to none. Then I had to restart the device and open my app calling hasEnrolledFingerprints().

As stated by @AnxGotta it seems to be caused by a Firmware issue. However I found a cleaner solution then adding a try catch. I just needed to call isHardwareDetected() before hasEnrolledFingerprints().

Upvotes: 0

AnxGotta
AnxGotta

Reputation: 1004

I found a support thread with Samsung where it was mentioned that this was a Firmware issue with the devices.

LINK

I simply added a try/catch around the code to prevent the crashes.

This should be resolved in the Samsung Firmware update.

Upvotes: 3

Related Questions