Delay Keyguard

Tasker Developer Note: in Android 2.0+, the Keyguard action should probably not be used unless the display is *on* and *unlocked*, so try this profile at your own risk.

This "Recipe" will duplicate the function of a program on the market called "Autolock"

It turns the keyguard off after unlocking and turns it back on after the screen has been off for a set amount of time

You need to add two Event Profiles

  1. click New and select Event
  2. select Display then Display Unlocked
  3. Select Priority Normal
  4. click + in the bottom left to add an action
  5. select Display and then Keyguard
  6. change dropdown to Off
  7. click Done
  8. click Done
  1. click New and select Event
  2. select Display and then Screen Off
  3. select Priority Normal
  4. click + in the bottom left to add an action
  5. select Tasker and then Wait
  6. change Minutes to 1 (or 30 seconds or whatever you want)
  7. click Done
  8. click + in the bottom left to add an action
  9. select Display and then Keyguard
  10. change dropdown to On
  11. click Done
  12. click Done

When you unlock your phone the keyguard will turn off.
When the screen turns off you can still wake the phone without the lock screen for 1 minute (or whatever you choose)

Alternative way

The above combination of two scripts may re-enable Keyguard if you turn on the phone again within the 1 minute time span. This way, the Keyguard off-Event will fire while the Keyguard on-Event is still waiting and finally turning it on again.

To be able to handle this situation, we have to cram everything into one event, like this:

  1. click New and select Event
  2. select Display and then Display Unlocked
  3. keep Priority at Normal and click Done
  4. click + in the bottom left to add an action
  5. select Display and then Keyguard
  6. keep the setting at Off, click Done
  7. click + again
  8. select Tasker and Wait Until
  9. set Seconds to 30 (this is the interval, Tasker checks for the condition set in next step)
  10. further down in the Until field enter %SCREEN into the left field (or use the Label-button in the top right, you have to scroll up to reach it)
  11. click the ~ button and select Matches
  12. in the right field enter off
  13. click Done
  14. now add another action: click +, select Tasker and Wait (not Wait Until this time!)
  15. set it to 2 minutes (or however long it should take to re-enable Keyguard)
  16. click Done
  17. finally add another step: click +, select Display, then Keyguard
  18. change the setting to On, click Done
  19. to add the "magic", so that Keyguard stays off if you use your phone again within the time limit, open the Task Properties by clicking on the Screwdriver/Wrench-button in the bottom right (left of the help button)
  20. at Collision Handling select Abort Existing Task
  21. click Done
  22. click Done
  23. click Apply

Now when you unlock your phone, the task will run and will turn Keyguard off. Then it will check every 30 seconds whether the screen is turned off. If it is, it will wait 2 minutes and finally turn keyguard on again. If you unlock your phone in these 2 minutes, the currently running task will be cancelled and a new one will be started.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License