I have a game that disables inactivity lock on my phone as long as it is foreground (there's enough ways to do that if you look around on development SE sites). This is generally a good thing, since it have somewhat long-ish matches that can be set to autopilot and having to manually tap to prevent autolocking would be annoying.

However it is NOT fine when I set lock period in phone settings to half a hour, start playing before sleep and WANT it to go into lock if I actually fall asleep while playing! I don't want phone to stay at max heat all night because GPU and charger fight each other over energy flow. I have an unrooted Lenovo A1000.

Application does not have any setting to disable this behavior. Is there a way I can enforce my lock period settings on any application so any time I don't actively touch any controls on phone for specified time, it goes into a lock, no matter if foreground application wants that or not?


You can give this a try using Macrodroid automation app

Trigger: Empty


  1. Wait 30 minutes ( assuming that is the time after which you want to activate screen lock )

  2. Set screen lock → screen lock on (this particular action doesn't work on some devices)

Constraints: None

Create this macro , name it and save. Go to widgets of your home screen and drag and drop Macrodroid widget on any screen. Long press the widget and assign the name of macro

When you want to activate screen lock , click the widget to run the macro and test if lock screen functions as expected over riding the behaviour of lock screen. You can reduce the wait time for testing

If your device was rooted , a sure way was to kill the game app after the set duration

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.