Reputation: 1569
In FingerPrintSensor enabled devices when we restart a device it temporarily disables fingerprint and force user to unlock device using pin/password/pattern. I want to achieve this functionality so i am using DevicePolicyManger to lock user device.
mDevicePolicyManager.lockNow();
The problem is it does lock device but disables fingerprint only in few devices or ROMs. I have Redmi Note 3 with Custom rom like lineage OS and Mokee Rom it lock screen and also disables fingerprint. But with MIUI it just locks device but doesn't disable fingerprint.
Why does this behave like this? How can i make sure it disables fingerprint authentication with every device/rom or is there any another alternative to achieve this?
Upvotes: 3
Views: 6081
Reputation: 2510
You can try using setKeyguardDisabledFeatures with KEYGUARD_DISABLE_FINGERPRINT set to either completely disable them or just disable them when you use the locknow API, re-enabling it later.
As for the custom ROMs, are they all based off the same version of Android? If they are Android 7.0+, I'd look to see if MIUI is using full disk encryption instead of file based encryption with direct boot. There are some intricacies in the behavior between those two encryption methods and the keyguard security is tied to the respective encryption keys. On a restart, fingerprints cannot be used because they're not considered strong enough method to unlock the hardware-backed keystore.
Upvotes: 3
Reputation: 7
Use app locker, if you have a fingerprint device using 7.0 + then you can add what kind of security you want on an app by app basis, native in Android, no extra app locker app needed though you could use one(like authenticator if you need 2FA) but it doesn't sound like you do. You wouldn't need to put this in your app as the system would override that manifest if the end user sets this in settings>security/fingerprint>app locker within the system anyway.
https://i.sstatic.net/iYEO2.jpg
Edit: Where it says "choose your encryption for app" you can specify whether you want a pin/pattern/password for apps
Upvotes: 0
Reputation: 7
My simple answer is to encrypt the device which should force a pin/pattern on boot or reboot, in theory, but I do not know if this applies to every OS. If you try it and the problem resolves, then the OS/device would require encryption/decryption to behave a certain way. That's where I would start.
Upvotes: 0