Screen lock without turning off the fingerprint

I have the following problem. I am trying to make an application that locks the screen. The method using DevicePolicyManager works very well. So far, so good. But when I lock my phone with DPM, the fingerprint unlock method is disabled and I have to enter my template (or PIN or something else that I set) to unlock the phone. If I lock it in the usual way (i.e. with the power button), fingerprint unlocking will work.

So my question is: How to lock the screen programmatically and be able to unlock it with a fingerprint?

PS: I have a s5 mini galaxy with the ancestor of os

+5
source share
2 answers

This is a normal flow. The device restarts when the device asks for a template or password. Google has not provided any api for this. You can check out any application in the PlayStore that has a blocking function that behaves as follows.

Edited: For the queries below you answered that the general answer is here

  • How can a user lock their phone without using the power button (for example, through the application) and still be able to unlock it with a fingerprint?

    Intentionally, there are no API applications for applications to lock the device.

  • Is there a reason or concern for security?

    Yes, there is a problem with DOS (denial of service) if we allow applications to block the device. Either intentional or accidental (application error).

Found here [ https://code.google.com/p/android/issues/detail?id=79735#c115]

I think you need to look for how to lock the application shortcut, not the power button. At least I could help at this level.

+1
source

Pay attention to how the accelerator regained its path. screen lock via apex launcher does not disable the fingerprint scanner!

In fact, this is what it sets so that the screen ends in black, i.e. soft lock (which gives the user a false impression of the screen), and then after 5-10 seconds the display really turns off due to a timeout.

another application that implemented the same functions OFF + (Support for unlocking the screen / Fingerprint) . (I think this is modifys "screen lock timeout" )


If the phone is rooted, a shell command may be executed to launch the input keyevent 26 power key, but there may be a slight delay.


Well, if some root user is looking, there is also an xposed module that solves this problem. FingerprintEnabler

+2
source

Source: https://habr.com/ru/post/1265674/


All Articles