Yes, another tasker howto for you android fanbois...
So I'm lazy and hate to have to unlock my phone unnecessarily. I also get text messages that require it. So I thought, hey dumbass why not have Tasker unlock it for you? So this project was born. When a new text is received, tasker will automatically turn off the PIN/password/keyguard. It will then wait five seconds and if you haven't turned your phone on, it will relock it. I thought this was a good balance between security and convenience.
So lets get started. You'll need to have purchased (or downloaded the trial of)
Tasker and installed the free version of the amazing Tasker plugin,
Secure Settings. There will be a total of three profiles used. One for when the new text comes in, one for when you turn the screen on to read it, and one for when you turn the screen off after reading it. Remember that Tasker has profiles and tasks. Profiles are "when this happens" and tasks are "do this". The ones were creating today look like this:
SMS - This profile is triggered when an SMS message is received and the screen is off.
- Set variable %SMSUNLOCK to 1. This is so that we can track when we've disabled the security. That way we know when to enable it again.
- Using Secure Settings plugin, Clear Password/PIN.
- Using Secure Settings plugin, Disable Keyguard.
- Wait 5 seconds
- Set variable %SMSUNLOCK to 0, IF %SCREEN = Off. These next few, we want to make sure the screen is off, meaning that we did NOT turn it on to read the text.
- Using Secure Settings plugin, Enable Keyguard, IF %SCREEN = Off.
- Using Secure Settings plugin, Set PIN, IF %SCREEN = Off. I use a PIN. If you use pattern or password, obviously use that option.
- Stop. This step isn't required, but its good programming.
SMSScreenOn - This profile is activated when the screen is on and %SMSUNLOCK = 1, meaning that we've turned the phone on within the 5 second countdown.
- Set %SMSUNLOCK to 2.
SMSScreenOff - This profile is activated the screen is off and %SMSUNLOCK = 2, meaning that we checked the message while the security was off. So now we need to reenable the security.
- Set variable %SMSUNLOCK to 0.
- Using Secure Settings plugin, Enable Keyguard
- Using Secure Settings plugin, Set PIN
And that's how you do it. If you'd prefer to not type this all in, I've attached the Tasker XML files here that you can simply import into your own Tasker setup. To import in Tasker, simply long press on the Profiles tab and select Import.