[Nexus 7 Themes and Apps] GeeBee29:
Delaying keyguard after screen display off with tasker

What I wanted Tasker to do is when the screen display turns off wait 10 seconds for me to turn the display on again before

the keyguard or screen lock (whatever you want to call it) kicks in.

Here is my phone and setup...

Phone : Sony Acro S (LT26w) with root access and custom recovery (stock ROM and kernel)

Android version : 4.0.4

Tasker version : v4.0u1m

Secure Settings version : v1.3.2

Helper version : v1.2.2

NOTE: IF YOU DON'T HAVE ROOT ACCESS (OR KNOW WHAT THAT MEANS) THEN THIS PROBABLY WON'T WORK FOR YOU!

NOTE: I RUN THIS TASKER PROFILE AND TASK ON MY OWN PHONE AND A HP TABLET WITH NO PROBLEMS. THEY BOTH HAVE ROOT ACCESS AND RUN ANDROID 4.0.4. RESULTS MAY VARY ON OTHER SYSTEMS.

In Tasker I always start with the creating the Task, then creating the Profile that triggers the Task. That way I can test the Task completely before commiting to a particular Profile - especially useful if you're worried about infinite looping within your Task or when using risky system/root access functions for the first time.

This Task assumes you get the same return values for the %KEYG and %SCREEN variables as i did as they ARE CASE SENSITIVE and must match perfectly. I created a test Task to flash both of these values when I had my GPS location on and screen display on and both variables returned "on". They could have showed On/ON/off/Off/OFF or any other variant so it's best to check. If your phone flashes something like "Keyguard is set off" or "Screen Display is Turned ON" or anything else then you're gonna have to type all that in EXACTLY as it appears at the appropriate point.

Let's get into it!

Run Tasker and select the TASKS tab. Then...

+ -> enter any name you want...I called mine "Display Off Keyguard Mod"

+ -> Task -> If -> %KEYG ~ on

+ -> Plugin -> Secure Settings -> beside Configuration click on Edit -> Keyguard -> Off -> Save (bottom left corner)

+ -> Task -> End If

+ -> Task -> Wait -> set to 10 seconds

+ -> If -> %SCREEN !~ on

+ -> Plugin -> Secure Settings -> beside Configuration click on Edit -> Keyguard -> On -> Save (bottom left corner)

+ -> Task -> End If

+ -> Task -> Stop

Back out to Save then go to the PROFILES tab and ...

+ -> Event -> Display -> Display Off -> select the created "Display Off Keyguard Mod" task (or whatever you called it).

Back out to Save. Make sure Tasker is Enabled then back out to your home screen.

FIRST TEST: Press (not hold) the power button to turn off your phone's screen display. Wait a quick 3 seconds (less than 10 seconds at least) then press the power button again to turn on the screen display. You should have your home screen now without having to unlock your phone AND you should have a persistant notification saying the Keyguard is Disabled. DON'T WORRY...KEEP GOING!

SECOND TEST: Press (not hold) the power button to turn off your phone's screen display. Wait a good 12 seconds (more than 10 seconds at least) then press the power button again to turn on the screen display. You should have your normal keyguard or lock screen again. Once you've unlocked your phone the Keyguard notification should be gone as well.

I ignore the persistant notification as I don't often wake my phone up shortly after locking it and the notification issue does resolve itself next time the display is off for longer than 10 seconds. I'd be very grateful for any solutions on how to solve this problem.

Enjoy :)