I actually just did this last week and so far it's worked great (huge
disclaimer: There might be a better way to accomplish this but I know
that this will work).
The idea is that tasker would notice that proximity sensor is in use,
then wait a certain amount of time before it turned the screen off if
the proximity sensor was still engaged.
First I made a Profile where the State--> Proximity Sensor--> Variable
Set "%Proximity ~ On", then Variable Set "%Proximity ~ Off" as the
exit task. I made it a Global variable so I can use it in other
profiles...you might too.
Then I made 2 more Global Variable Profiles based on the phone State.
Phone Offhook -->Variable Set "%OnCall ~ 1"
Phone Idle --> Variable Set "%OnCall ~ 0"
Then I made another Proximity Sensor Profile called "Pocket Screen
Off", then made a task called "Screen Off" where:
1. Stop If %OnCall ~ 1
2. Wait 2 Seconds
3. If %Proximity ~ On
4. Wait 3 Seconds
5. System Lock if %Proximity ~ On
Lastly I added a NOT Application Context to the "Pocket Screen Off"
profile so that it would not engage during certain applications where
I put the phone to my ear (such as Voicemail)
As the disclaimer states, there is probably a cleaner method...
On Mar 5, 9:37 pm, wiiareonfire <
wiiareonf...@gmail.com> wrote:
> Does anybody know of a way to get the screen to lock if the proximity
> sensor triggers, and there's been *x* *seconds *inactivity?