Ask / Submit

Any workaround for malfunctioning proximity sensor (XA2)?

Tracked by Jolla

asked 2018-11-14 16:00:13 +0200

Daniel.T gravatar image

updated 2018-12-03 21:18:39 +0200

JSEHV gravatar image

Ok, in the release notes for Sailfish X Jolla wrote for XA2-specific issues: "Display blanking is unstable during phonecalls or alarms (due to proximity sensor)." Unfortunately, in my case that means: as soon as I initiate or answer a phone call, the display gets blanked and I can't interact in any way. No obvious way to hang up. Do you experience the same problem? Is there any way to hang up with a dark display? At the moment I can't make use of one of the core functions of a phone: making phone calls ;)

EDIT: CSD tool shows that the sensor itself is working correctly

edit retag flag offensive close delete



Display is unresponsive using Clock, one can´t swipe the snooze function. Anyone else has same issue? I´m using SFOS X on XA2.

MyShipMyRulez ( 2018-11-14 17:30:42 +0200 )edit

I have had once problem with proximity Sensor, I guess. I made a call and when I finished call and tried to end call, screen was black and phone call was still going on. When I pushed power button, flashed screen normal and went immediately black again. I had to forced to shutdown phone.

tomjooonas ( 2018-11-14 21:16:17 +0200 )edit

I have the exact opposite as a problem: CSD tool shows that my proximity sensor is uncovered all the time. Putting my finger on the sensor bar above the display does not change the state of the sensor at all. During calls the display does not turn off and I accidentally hold calls or call other people with my cheek touching the display.

Edit: Restarting the phone fixed the problem. Oh the wonders a restart can do...

laubblaeser ( 2018-11-15 15:09:17 +0200 )edit

I have indeed issues when calling on the Xperia XA2 Plus. During the call the screen goes black, but when I want to use the keypad or end the call, the screen won't return to the visible state. It stays black.

When trying to wake up the screen by pressing the power button, the screen flashes quickly, but goes as fast as it came back to black. The only way to end the call is when the other end hangs up or when I keep pressing the power button to power down the device.

I used the CSD tool (by dialling ##310##) and checked the proximity sensor. It passed perfectly.

JSEHV ( 2018-12-03 21:16:30 +0200 )edit

I have this problem too with my XA2 (3.0.8 and now 3.0.11). This seems to be worse if have the phone with me outside where there minus degrees (celsius) even if the phone is inside the pocket where the temperature still is propably about +-0 celsius. Could be timeing issue of course so I can try the MCE tool tip.

2kanaa ( 2019-01-19 15:39:48 +0200 )edit

5 Answers

Sort by » oldest newest most voted

answered 2018-12-05 01:08:09 +0200

lethe gravatar image

updated 2018-12-05 03:16:24 +0200

On my XA2 (H4113), the proximity sensor works ok on device startup, but fails after a couple of hours (stuck in uncovered state).

I figured out that restarting sensorfwd will save me the hassle of rebooting the phone to get the proximity sensor working again. You can do this on using the terminal (developer mode required for devel-su):

$ devel-su systemctl restart sensorfwd

On my XA2, I automated this task to run every hour using a systemd timer, this is a dirty hack, but will hopefully fix the issue.

To do so, create a new file /etc/systemd/system/proximity-fix.timer (root required)

Description=Restart sensorfwd to fix proximity sensor



Create another file /etc/systemd/system/proximity-fix.service

Description=Restart sensorfwd to fix proximity sensor

ExecStart=/bin/systemctl restart sensorfwd

And finally, enable the timer:

# systemctl enable proximity-fix.timer
# systemctl start proximity-fix.timer
edit flag offensive delete publish link more


That's a cool workaround @lethe. :-) I'll try this one out. Thanx

FrankSiebert ( 2018-12-05 02:17:25 +0200 )edit

Thank you very much! Seems like a nice workaround. I'll try it, as triple press is sometimes a little tricky and not always helpful...

I hope I'll remember to revert it once Jolla has fixed the problem...

Daniel.T ( 2018-12-10 07:19:18 +0200 )edit

I have tried it and unfortunately it doesn't work reliably. Is this run as root? If I issue the systemctl restart sensorfwd, I have to do it with devel-su. A manual restart solves the problem temporarily. Is there any way to check whether the systemd timer works as expected?

Daniel.T ( 2018-12-16 11:32:18 +0200 )edit

One option to look whether the timer is scheduled:

systemctl list-timers --all | less

Looked not too good when I checked on my phone. I added to the timer file a line


After Reboot the timer is now listed with datetime entry for NEXT run. No Idea whether this will now give a stable result.

FrankSiebert ( 2018-12-16 13:46:29 +0200 )edit

Unfortunately, it doesn't run, if I interpret the output of systemctl list-timers --all correctly:

[nemo@Sailfish ~]$ systemctl list-timers --all NEXT LEFT LAST PASSED
UNIT ACTIVATES n/a n/a n/a n/a
proximity-fix.timer proximity-fix.servic e

@lethe, is this the expected behaviour or am I doing something wrong?

Daniel.T ( 2018-12-16 20:33:02 +0200 )edit

answered 2018-11-14 22:18:38 +0200

spiiroin gravatar image

Occasionally misbehaving proximity sensor: Do triple power key press -> proximity sensor is ignored until it starts reporting changes again (e.g. when call starts ringing but display does not come up).

More or less permanently misbehaving proximity sensor: Tell mce service not to utilize it by executing from command line:

mcetool --set-ps-mode=disabled

For some more details, see:

edit flag offensive delete publish link more


I guess the triple power key press is the workaround I was asking for, but if the problem persists, I will try it the mce-way, thank you!

As the proximity sensor itself seems to be OK (according to CSD tool): is this problem something that can/will be solved in an upcoming update?

Daniel.T ( 2018-11-15 04:52:27 +0200 )edit

I hope indeed they will solve it with a future software update, as it doesn't look to me as a hardware malfunction when the CSD tool test passes for the proximity sensor.

And I certainly like this sensor, so I don't want to disable it permanently :)

JSEHV ( 2018-12-03 21:21:58 +0200 )edit

The triple power key is the workaround I use.
I was using it also on my old Jolla 1 with broken screen near the proximity sensor.

VincentB ( 2019-02-20 21:00:49 +0200 )edit

answered 2018-12-04 14:56:30 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2018-12-04 20:30:59 +0200

JSEHV gravatar image

The below command sequence makes the proximity sensor work again.

I did not yet check whether the second line alone will do the trick as well. A workaround could be a time triggered service running above command lines once an hour or so.

mcetool --set-ps-mode=disabled
mcetool --set-ps-mode=enabled
edit flag offensive delete publish link more


You could comment on the already accepted answer by @spiiroin, instead of adding a new answer.

addydon ( 2018-12-04 17:11:02 +0200 )edit

I considered that option, especially since the information from @spiiroin was very helpful in the discovery of the alternative workaround. Thanx

FrankSiebert ( 2018-12-04 17:44:04 +0200 )edit

Actually, the fact that toggling mce's proximity sensor use off and back on does something useful is interesting.

Normally in sfos mce is the only thing that uses / tracks proximity sensor state -> sfos sensorfwd enables/disables the sensor based on mce's needs -> a "toggle off, toggle on" at mce causes sensorfwd to power cycle the sensor via android hal.

And android hal is not really designed with multiple concurrent users in mind, so... If there were some other process in addition to sfos sensorfwd controlling the sensors via hal, it could cause situation where sensorfwd thinks the sensor is powered on, but actually it is powered off -> As far as the sfos sensor stack is considered, the sensor would get stuck to whatever the last seen value would be.

spiiroin ( 2018-12-05 09:32:47 +0200 )edit

Hello @spiiroin I understand: Probably a malicious process powers the proximity sensor off, bypassing sensorfwd and mce. Sonsorfwd keeps then thinking that the sensor is still on. As you mention android-hal, it might be a helpful information that I use the free/trial version.

FrankSiebert ( 2018-12-05 10:27:55 +0200 )edit

answered 2019-02-19 16:26:42 +0200

kauzimaeki gravatar image

I have a XA2 with SFOS V. and the behaviour of the proximity sensor is like above explained. I didn't use the discussed workarounds because its just a temporarily solution. I hope with the next update all will be fine again.

edit flag offensive delete publish link more

answered 2018-11-14 19:24:16 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2018-12-04 20:30:49 +0200

JSEHV gravatar image

with me the same, brightness sensor does not respond, but battery is better now.

edit flag offensive delete publish link more



thats no answer. Sorry, but its well known, that there is a problem. If you want to say "here too", than please upvote the question simply.

mettska ( 2018-11-14 22:53:36 +0200 )edit
Login/Signup to Answer

Question tools



Asked: 2018-11-14 16:00:13 +0200

Seen: 2,220 times

Last updated: 2 days ago