I have an application for night hours and I want to disable keyguard for the device while the application is running. And the device is on the charger. The idea is that if you are on a charger and this application works, then it is reasonable to assume that you are in a safe place. When the application exits (either through the back or home), I DO NOT want the unlock screen to appear, just allow normal use, as if the phone had never worked in standby mode longer than the deviceโs lock time.
Currently my application uses the FLAG_SHOW_WHEN_LOCKED window option and it keeps the screen on and unlocked perfectly, but when I hit back or home (after the lock time has expired), I get a keyboard unlock screen to unlock the device. I want to prevent this blocking of other applications while my application and device are running on the charger. I will obviously make this functionality the setting that the user selects, but how to implement it?
Can someone help me with this - all my googleing attempts indicate that I will only block my application, but I have already decided that this is allowed.
Thanks.
source share