• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Lock when not on wifi not working

I have an LG G4 running lollipop (not carrier specific) and I've setup a profile to put a PIN on whenever not connected to wifi.

But it doesn't quite work. Sometimes on wifi it asks me for a PIN .. no PIN works and a few times after turning the screen on and off I can unlock it without one. And in the other case sometimes when not on wifi it reveals the screen though I can't interact and after a few seconds the keypad comes up.

I've tried a few permutations and diagnostics but all to no avail.

What I have is pretty simple:

Wifi connected state with entry and exit tasks
On entry : secure settings > clear password
On exit : secure settings > set PIN

Curiously I put a different audible beep after the clear and set PIN commands to see when they're run - and I hear the correct beep. Which in theory means the command before it should have been run. Yet most of the time the phone reacts as if the task hasn't run until I use it.
 
Maybe you should check your device's Security Settings. Under Device Administrators check if Tasker is enabled.
 
Just a guess ... timing ...

Try "playing: with an inserted 500ms Wait action here an d there. It might be that some external activity has not completed thoroughly and is sometimes missed. The Wait when inserted in the correct place can sometimes compensate for that.

Also ... when making any change in Tasker ... always go to a main screen ... select Exit ... select Save First. This is the only way to guarantee that the change you think you just made is actually made and known by all the elements.

... Thom
 
Just a guess ... timing ...

Try "playing: with an inserted 500ms Wait action here an d there. It might be that some external activity has not completed thoroughly and is sometimes missed. The Wait when inserted in the correct place can sometimes compensate for that.

Also ... when making any change in Tasker ... always go to a main screen ... select Exit ... select Save First. This is the only way to guarantee that the change you think you just made is actually made and known by all the elements.

... Thom

Thanks, tried both including a seconds delay before and after the secure settings task. Same behaviour though, on connecting to wifi I am asked for a PIN which doesn't work and then next time the keypad doesn't appear. With no wifi the first time the keypad doesn't appear. Infuriating...
 
OK - I've found a solution.

It appears that the task to set or clear the PIN didn't seem to happen until I interacted with the phone. So I added an explicit task to turn the screen on. And it worked.

Here precisely is the solution. After the Secure Settings call to set or clear the PIN I added another Secure Settings task.

Secure Settings > Actions > Wake Device > "Screen and keyboard Lights On" for 1 second.

That's done it, it now behaves as you'd expect.

It also makes it easy to test because you can see exactly when the task runs. I might see what other similar options (Screen Bright / Screen Dim / CPU Awake only) work, but at least I now have a functioning profile.

Thanks to vosg an Thom for their help!
 
A quick update for anyone else having a similar issue: I was occasionally finding that when on wifi I would end up on a home screen which would ignore input. I could only get past this by swiping down from the lockscreen to access settings.

When on wifi I was occasionally seeing the screen light up, so I presume the lock and unlock tasks were running in quick succession and leaving the phone in an odd state. The solution to this was to insert a 10 second delay into the beginning of the tasks. This has seemed to work, so I thought I'd add it for anyone else having a similar problem.
 
Back
Top Bottom