17

I'm seeing a lot of exceptions in our production app when enabling fingerprints coming from Android 6 users, which I cannot reproduce on any of my local Samsung devices. The stacktrace is:

Message: SecurityException: Permission Denial: getCurrentUser() from pid=24365, uid=10229 requires android.permission.INTERACT_ACROSS_USERS android.os.Parcel.readException in Parcel.java::1620 android.os.Parcel.readException in Parcel.java::1573 android.hardware.fingerprint.IFingerprintService$Stub$Proxy.hasEnrolledFingerprints in IFingerprintService.java::503 android.hardware.fingerprint.FingerprintManager.hasEnrolledFingerprints in FingerprintManager.java::762 android.support.v4.hardware.fingerprint.FingerprintManagerCompatApi23.a in SourceFile::39 android.support.v4.hardware.fingerprint.FingerprintManagerCompat$Api23FingerprintManagerCompatImpl.a in SourceFile::239 android.support.v4.hardware.fingerprint.FingerprintManagerCompat.a in SourceFile::66 

This is just using the standard FingerprintManagerCompat class from the support library, and the check works correctly on other devices.

I don't want to add this permission to my app - it seems to have nothing to do with fingerprints.

Has anyone encountered anything like this?

5
  • In order to reproduce this issue you need to have fingerprints registered but no screen lock: swipe or none. Otherwise, there is no problem. Either way, is there any solution for this case? Commented Dec 14, 2016 at 15:10
  • @Petrakeas for the scenario of fingerprints enabled but no lock screen, I already have a check for KeyguardManager.isKeyguardSecure() Commented Jan 4, 2017 at 20:36
  • In my S7 the problem was only reproduced in the case that isKeyguardSecure() returned false. Calling the 2 methods in @David Medenjak's answer solves the problem even in this case. Commented Jan 5, 2017 at 12:20
  • 1
    @Petrakeas I needed to do one extra thing to reproduce this issue. So first you need to have fingerprints registered and screen lock set to swipe or none. Then I had to restart the device. After that I was able to reproduce this issue constantly. And as you mentioned the answer of David Medenjak solves this problem. Commented Jan 24, 2017 at 8:45
  • @Wirling On my Huawei device, if I set my screen lock set to Swipe or None, then it deletes all the registered Fingerprints. Commented Aug 28, 2018 at 15:38

2 Answers 2

23

I came across the same problem on a Samsung Galaxy S6, running Android 6.0.1

The Problem was caused by calling

fingerprintManager.hasEnrolledFingerprints() 

I fixed it by adding a call to check for hardware before:

fingerprintManager.isHardwareDetected() && mFingerprintManager.hasEnrolledFingerprints() 

Checking for fingerprints without the hardware available seems to cause this exception on some devices.

Sign up to request clarification or add additional context in comments.

6 Comments

I do this exactly and still have the issue. I added this information to my question. Thanks for the input.
@kos On which devices do you see the issue?
I also get same error. And I checked my code, I've just added hardwareControl before call hasEnrolledFingerprints(). Do you have another idea?
@atasoyh No, I'm sorry. This fixed the issue for me back in the day. I didn't do any more tests
This code works for me, Samsung J1 Mini 6.0.1. I've check first if isHardwareDetected() before calling hasEnrolledFingerprints()
|
0

If this is happening after you upgrade your Phone OS , Go to developer options --> Verify apps over USB --> Switch it off , learned it the hard way , hope it helps some valuable time ! enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.