Originally Posted by Spookymyo
Thanks for the reply. I downloaded your XML project from media fire but when I tried to import it I got an error saying it failed to import data. I checked the XML in a text editor and noticed a lot of text strings with "media fire" and "Google". I don't think that should be the case.
Edit: Nevermind. I opened it in a different browser and it downloaded the proper file. I'll test it and see if it's what I was taking about.
Edit 2: That's money dude! That's so much easier than I thought. I had 4 different tasks and a few different variables. Thanks a ton!
Edit 3: I added a notification sound when the screen actually turns off. That way I'm not wondering if it did or not.
I noticed that when I turn the screen back on the flash text (Please wait 5 seconds) always displays. Does this mean that your project is always polling the proximity sensor even when the screen is off? In Tasker preferences, under the monitor tab, I have the proximity setting at No.
I'm glad I helped you. I'm still a noob
I've tried again and it seems that you're right about the flash text. And I've figured out why: because when screen was going on after it was off, the variable %PROX still had value 1 (so it was triggering the profile), but then it was going to 0. I think that's it. In any case, I've made some changed and now that problem is gone.
I've made following changes:
- added two profiles to know if the screen is locked or unlocked. When it's unlocked, it also means that the screen is on
- added a state not call any, so the screen won't turn off when you're in a call (because when you have the phone at ear, the proximity sensor stays on, so we don't want our profile gets triggered that time)
- added a state display on at proximity profile which play with the %PROX variable, so the proximity sensor won't get triggered when you have the phone in pocket for example. It will trigger only if the screen is on
NEW version here
PS: let me know how it goes with the battery drain , if is minor or major. I'm just curious because i didn't use a profile with proximity sensor and I don't need this one.