androiddevice-admindevice-policy-manager

Temporarily disabling fingerprint


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?


Solution

  • 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.