6

I have an app that uses fingerprint-authentication. As an extra security-measure I'd like to detect whether the fingerprint is used to unlock the device. I tried retrieving the lock-mode in the following way:

long mode = android.provider.Settings.Secure.getLong(contentResolver, PASSWORD_TYPE_KEY,
            DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);

But according to this post check whether lock was enabled or not the results may be different.

Is there a way to determine that fingerprint is used to unlock the device?

Community
  • 1
  • 1
Wirling
  • 4,810
  • 3
  • 48
  • 78
  • hey first thing you must check whether there is any isKeyguardSecure of KeyguardManager class is applied or not for fingerprint.If it is applied you can then check whether at least one fingerPrint is registered through this method hasEnrolledFingerprints() of FingerprintManager class.If this return true means the phone is locked through FingerPrint.Please let me know whether i helped you or not. – Sagar Gangawane Nov 09 '16 at 06:14
  • @SagarGangawane: isKeyguardSecure checks if you're using any screen lock but not which one. And hasEnrolledFingerprints() only checks if you have enrolled any fingerprints but not if you have fingerprint-authentication enabled. So for example I might have pincode as screen-lock and have some fingerprints enrolled, both methods will return true. However that doesn't mean that you're using the fingerprints to unlock the device. – Wirling Nov 09 '16 at 06:45
  • 1
    @SagarGangawane I'm also middle of this problem, did you find any solution – blackHawk Jun 10 '18 at 07:41
  • 1
    @Wirling did you find any solution to this problem? – Waqas Ahmed Ansari Mar 12 '19 at 05:01
  • @WaqasAhmedAnsari Nope still didn't find a solution. Our security department didn't find it necessary after all. – Wirling Mar 12 '19 at 06:14

0 Answers0