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
- click New and select Event
- select Display then Display Unlocked
- Select Priority Normal
- click + in the bottom left to add an action
- select Display and then Keyguard
- change dropdown to Off
- click Done
- click Done
- click New and select Event
- select Display and then Screen Off
- select Priority Normal
- click + in the bottom left to add an action
- select Tasker and then Wait
- change Minutes to 1 (or 30 seconds or whatever you want)
- click Done
- click + in the bottom left to add an action
- select Display and then Keyguard
- change dropdown to On
- click Done
- 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:
- click New and select Event
- select Display and then Display Unlocked
- keep Priority at Normal and click Done
- click + in the bottom left to add an action
- select Display and then Keyguard
- keep the setting at Off, click Done
- click + again
- select Tasker and Wait Until
- set Seconds to 30 (this is the interval, Tasker checks for the condition set in next step)
- 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)
- click the ~ button and select Matches
- in the right field enter off
- click Done
- now add another action: click +, select Tasker and Wait (not Wait Until this time!)
- set it to 2 minutes (or however long it should take to re-enable Keyguard)
- click Done
- finally add another step: click +, select Display, then Keyguard
- change the setting to On, click Done
- 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)
- at Collision Handling select Abort Existing Task
- click Done
- click Done
- 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.