Proximity Sensor not working after System Lock

358 views
Skip to first unread message

muewa

unread,
May 16, 2011, 8:41:43 AM5/16/11
to Tasker
Hello,
My Tasker profile displays a message when the "Proximity Sensor" gets
activated and deactivated.
This works fine, EXCEPT, after a "System Lock". The first cover/
uncover of the sensor after a System Lock gives no Tasker reaction (no
message displayed), even though a sensor test program running in
parallel indicates the Proximity Sensor works as expected. All
following cover/uncover are handled as expected (message displayed).
I am using a Samsung Galaxy S2 (Gingerbread, 2.3.3), Tasker 1.0.21u2m
Please help

Pent

unread,
May 16, 2011, 12:46:54 PM5/16/11
to Tasker
> My Tasker profile displays a message when the "Proximity Sensor" gets
> activated and deactivated.
> This works fine, EXCEPT, after a "System Lock". The first cover/
> uncover of the sensor after a System Lock gives no Tasker reaction (no
> message displayed), even though a sensor test program running in
> parallel indicates the Proximity Sensor works as expected. All
> following cover/uncover are handled as expected (message displayed).

I would not expect Tasker to respond to the proximity sensor at all
after a
System Lock. Usually it stops monitoring the sensor when the display
goes
off to save battery. I just tested that both via power button and
System Lock
on my Nexus S.

> I am using a Samsung Galaxy S2 (Gingerbread, 2.3.3), Tasker 1.0.21u2m

Standard ROM ?

Pent

muewa

unread,
May 16, 2011, 1:37:20 PM5/16/11
to Tasker
> I would not expect Tasker to respond to the proximity sensor at all
> after a
> System Lock. Usually it stops monitoring the sensor when the display
> goes
> off to save battery. I just tested that both via power button and
> System Lock
> on my Nexus S.

Sorry, I was not clear. The proximity sensor does not work
on the first cover/uncover after unlocking from a system lock.

- system active
- cover/uncover -> Tasker message as expected
- power button -> system locked
- power button, unlock pattern swype -> system unlocked
- cover/uncover -> no Tasker message
- cover/uncover -> Tasker message as expected
- cover/uncover -> Tasker message as expected
- ...

> > I am using a Samsung Galaxy S2 (Gingerbread, 2.3.3), Tasker 1.0.21u2m
> Standard ROM ?

Yes, Standard ROM, not rooted

Thank you, muewa

Pent

unread,
May 16, 2011, 2:38:10 PM5/16/11
to Tasker
> Sorry, I was not clear. The proximity sensor does not work
> on the first cover/uncover after unlocking from a system lock.

Ah, that's a different story :-)

But I still can't reproduce it, it works fine on my Nexus S.

How are you displaying a message ? Could you try it with

Wait 5
Notification Blah

Thanks,

Pent

muewa

unread,
May 17, 2011, 2:13:08 AM5/17/11
to Tasker
> How are you displaying a message ? Could you try it with

The Profile (in German...):

Profil: (Test (6)
Status:Näherungssensor
Eingang: Msg1 (2)
A1: Benachrichtigung [Titel:1 Text:<icon> Nummer:0 Dauerhaft:Aus]
Ausgang: Msg0 (3)
A1: Benachrichtigung [Titel:0 Text:<icon> Nummer:0 Dauerhaft:Aus]

As already said, a sensor test-program indicates that the proximity
sensor
itself is working, just no Tasker reaction on the first cover/uncover
after
unlocking.

BTW: is there a method to export a profile in English (in a German
setup)?

Thanks,
muewa

Pent

unread,
May 17, 2011, 4:07:27 AM5/17/11
to Tasker
> > How are you displaying a message ? Could you try it with

Could you try what I mentioned ?

> BTW: is there a method to export a profile in English (in a German
> setup)?

Not when you're language is set as German, sorry.

Pent

muewa

unread,
May 17, 2011, 7:15:15 AM5/17/11
to Tasker
> Not when you're language is set as German, sorry.

I set my Tasker language to english...

> Could you try what I mentioned ?

I thought I did :-( I now added the wait, still no Tasker
notification on the first cover/uncover.

Profile: test (6)
State: Proximity Sensor
Enter: Msg1 (2)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0]
A2: Notify [ Title:1 Text: Icon<icon> Number:0 Permanent:Off ]
Exit: Msg0 (3)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0]
A2: Notify [ Title:0 Text: Icon<icon> Number:0 Permanent:Off ]

(If "Notify" is not what you meant, please indicate where to find
"Notification")

Thanks,
muewa

Pent

unread,
May 17, 2011, 2:25:29 PM5/17/11
to Tasker
> > Not when you're language is set as German, sorry.
>
> I set my Tasker language to english...

I can read German BTW :-)

> I thought I did :-(  I now added the wait, still no Tasker
> notification on the first cover/uncover.

OK, I can't reproduce it but I'll have a look at a log if you like:

http://tasker.dinglisch.net/faq-how.html#x

If you could make it immediately after the failure that would be
great.

Pent

drsood

unread,
May 17, 2011, 2:57:37 PM5/17/11
to tas...@googlegroups.com
i had reported this problem in my post https://groups.google.com/d/topic/tasker/TkUi1jpVKQc/discussion (specially the second post)
i didnt get any reply. i shall be really happy if this problem is solved

Pent

unread,
May 17, 2011, 4:42:03 PM5/17/11
to Tasker
> i didnt get any reply.

Sorry, I do miss some.

Pent

drsood

unread,
May 18, 2011, 2:30:49 AM5/18/11
to tas...@googlegroups.com
dont b sorry Pent...i know that u answer a lot of users queries each day...n obviously u can miss a few

anyways i m uploading the logcat
i initially created two profiles one with "proximity state" which creates a green icon notification in notification i.e. proximity is active
the other one with "invert proximity state" which creates a red icon notification whenever the proximity sensor is uncovered

as u can see in log, at time 11:45:04.549, i covered the sensor with my finger
at 11:45:15.042, i pressed the sleep/wake mode button of my mob...and only after that i uncovered the sensor
at 11:45:29.210, i presed the sleep/wake mode button...the screen turned on..n the proximity notification showed a green icon (although it should have shown the red icon coz sensor was not covered)
then i covered the sensor, notification icon ws green, i uncovered it and the icon turned red

i would really appreciate if u can help Pent...thnx in advance
logcat.txt

Pent

unread,
May 18, 2011, 4:30:32 AM5/18/11
to Tasker
> as u can see in log, at time 11:45:04.549, i covered the sensor with my
> finger
> at 11:45:15.042, i pressed the sleep/wake mode button of my mob...and only
> after that i uncovered the sensor

Ahhhh, that one I can reproduce. But when I unlock the screen the exit
task runs. It's probably because the sensor only starts being
monitored again when the display is unlocked.

Will have a look at starting the sensor with display-on rather than
display-unlock (no promises).

I don't think that's the problem of the original poster though ?

Pent

drsood

unread,
May 18, 2011, 4:54:38 AM5/18/11
to tas...@googlegroups.com
for me, the exit task is not executed when i unlock the screen (i m using widget locker, by d way)
it only gets executed once i cover/uncover the sensor

i guess muewa's and my problms are almost same..excpt that he's usin system lock n i m usin the normal lock screen..
Muewa...is that correct??

muewa

unread,
May 18, 2011, 6:11:09 AM5/18/11
to Tasker
> i guess muewa's and my problms are almost same..excpt that he's usin system
> lock n i m usin the normal lock screen..

Sorry, I am new to Android. I am not aware there are different types
of locks...

The one I have problems with is the one entered
- when short pressing the power button of the phone
- executing "Display Action/System Lock" in Tasker
- Screen Timeout

I think we do have the same problem...

muewa

drsood

unread,
May 26, 2011, 9:01:06 AM5/26/11
to tas...@googlegroups.com
Pent, Thanks a lot for fixing the proximity issue..in the new beta

muewa

unread,
May 27, 2011, 6:30:04 AM5/27/11
to Tasker
I retested on the beta version and found some improvement (Thanks!),
but still some problem:

As before I use a profile displaying a notification "1" when the
sensor is covered, and another one "0" when uncovered.

1.) cover the sensor -> notification "1"
2.) lock the phone (short press on power button, while sensor still
covered)
3.) uncover the sensor (of course no notification)
4.) unlock the phone -> no notification (!)
5.) cover the sensor -> no notification (!)
6.) uncover the sensor -> notification "0"

I am looking for a way to have a variable "always" indicating the
state of the sensor. As notifications are missing on 4) and 5) my
variable is "unreliable" after unlocking.

(My problem would not exist if there were a way to poll the current
state of the sensor, did I miss something?)

muewa

muewa

unread,
May 27, 2011, 7:37:59 AM5/27/11
to Tasker
Workaround found:

I made a "DisplayOn" profile which disables my "Proximity Sensor"
profile and immediately reenables it. Now I get all expected
notifications.

Thank you again,
muewa

Pent

unread,
May 27, 2011, 7:38:57 AM5/27/11
to Tasker

> 1.) cover the sensor -> notification "1"
> 2.) lock the phone (short press on power button, while sensor still
> covered)
> 3.) uncover the sensor (of course no notification)
> 4.) unlock the phone -> no notification (!)

I got a notification at this point.

You sure you have at least 1.1b3 ?

If so, I'll need a log I guess.

Pent

muewa

unread,
May 27, 2011, 8:19:17 AM5/27/11
to Tasker
> You sure you have at least 1.1b3 ?

About/Credits shows 1.1b3m

> If so, I'll need a log I guess.

I'll try to do that...

muewa

muewa

unread,
May 27, 2011, 9:16:01 AM5/27/11
to Tasker
I just sent the logfile to sup...@apps.dinglish.net.

Good luck,
muewa

Pent

unread,
May 28, 2011, 4:46:26 AM5/28/11
to Tasker
> I just sent the logfile to supp...@apps.dinglish.net.

Sorry, didn't get it.

Pent

Pent

unread,
Jun 2, 2011, 1:29:02 PM6/2/11
to Tasker
OK, got it.

Tasker is correctly reenabling the proximity sensor when the display
comes on and the sensor manager logs that it's listening. Your ROM
just doesn't send a sensor event when the listener is initially
registered (unlike every other ROM it seems) so it's not possible to
detect the sequence you described.

I can't leave the sensor on while the screen is off because it uses
too much battery (I tested it overnight once).

Welcome to the wonderful world of Android fragmentation.

Pent

Murz

unread,
Jan 8, 2013, 3:04:10 AM1/8/13
to tas...@googlegroups.com
Hello! I got the same problem, can you describe more detail how did you disable/enable proximity sensor? I want to check proximity immediatly after screen on by power key and remove keyguard, but can't do this, because in Tasker proximity always show False result. Or maybe you can suggest any other solution? Thanks.

пятница, 27 мая 2011 г., 15:37:59 UTC+4 пользователь muewa написал:

RudeboyX

unread,
Jan 8, 2013, 6:08:34 AM1/8/13
to tas...@googlegroups.com
Not sure if it will help, but I found the most relyable way of handeling the proximity sensor when the screen comes on is to do the below

Profile 1 (proximity Monitor) (SET TO DISABLED)
Context - Proximity Sensor
Enter Task - Variable Set - %Proximity -> covered
Exit Task - Variable Set - %Proximity -> uncovered

Profile 2
Context - Screen On (SET TO ENABLED)
Enter Task - Profile Status - Set Proximity Monitor -> on
Wait 2 seconds
Profile Status - Set Proximity Monitor -> off

Now you just base your proximity profile on the "%Proximity" variable. This technique also saves battery as your proximity sensor is turned off 2 seconds after its turned on giving just enough time for it to alter the variable.

Regards
RBX
Reply all
Reply to author
Forward
0 new messages