Disable Proximity Sensor during call
Asked Answered
C

10

37

I dropped my phone and looks like my proximity sensor no longer works reliably. It returns Near all the time. The problem is, the display turns off during call and I wont be able to use the number pad to enter pin or conference another call, or even disconnect the call. I found the Power button disconnect option in Accessibility settings and uses that now.

I tried to create an app that tries to obtain a full wakelock when a call is received hoping that it will keep the display on.

  • Created a broadcast receiver that invokes a service when the phone state changes to OFFHOOK

  • The service acquires a full wakelock and releases it only when phone state is IDLE.

But still, proximity sensor turns the display off. I used the isHeld() method to make sure that the lock is acquired. I used PowerManager's isScreenOn() method and it returned true even when the screen was off during the call. I tried to obtain the wakelocks every two second in a loop for testing, still the display won't come up.

I'm using a Nexus 5 Android version 4.4.4

Can anyone suggest an idea to override the proximity sensor behaviour? A root-required option is also fine.

Thanks!

Carmella answered 27/7, 2014 at 15:44 Comment(5)
Get the app Hardware Disabler from Google Play Store Visit play.google.com/store/apps/…Jens
Do you have the ACQUIRE_CAUSES_WAKEUP flag set in your wakelock? It may be so that the screen goes dark before the wakeup is acquired. As per documentation, it says that acquiring the wakelock after screen off does not turn the screen on (it merely keeps it on if it was already on) unless that flag is set.Lacework
Yes,I have set this flag tooCarmella
the app com.hatcyl.android.Hardware_Disabler that user "my doubts" mentioned 2 comments above did the trick for me, simply blocked the device "/sys/bus/i2c/drivers/apds9702" with it on my sony xperia z, and starting a call will now leave the screen on (the link posted above did not work, I found an apk by googling the name -> size=99105bytes md5sum=cfdf0eaec8c259a8c43ce3cfcb3771f2)Burdett
"I found the Power button disconnect option in Accessibility settings and uses that now."... thanks for this! I have the exact same problem and while it looks like your solution didn't work for Android 5.x this was good enough to work for me...Howerton
E
1

Proximity Sensor Dial

*#*#7378423#*#*

1) Service Tests - (If present)

2) Proximity Switch

3) Test on sensor (Next to logo(top) of mobile)

4) Yes if works, then u can keep on and proximity switch forever which gives beep all the time and consumes lot of battery

OR

4) No it doesn't work - Then simply clean the mobile screen or screen guard and clear the blocked screen from sensor. It works charm.

Technically, Its not any software solution, but hardware solution will work.

Ethyl answered 3/12, 2016 at 4:56 Comment(1)
The last solution is where I ended up - used a compressed gas duster and sprayed into the sensor. That removed the debris and the phone started to function normally.Carmella
C
8

After trying a whole bunch of fixes including:

  • Phone app's menu option (my phone did not have a option to disable)
  • Proximity Screen Off Lite (did not work)
  • Xposed Framework with sensor disabler (works till phone is rebooted or app updates)
  • Macrodroid macro (Macrodroid does not run on my phone for some reason)
  • put some tin foil in front of it?(i don't know what i was thinking)

Here is My fix: I figured you cannot break it more so I opened up my phone and removed the proximity sensor all together from the motherboard. The sensor tester app now shows "no_value" where it use to give "Distance: 0" and my screen no longer goes black after dialing. Please note I can only confirm this working on a Samsung I8190 Galaxy S III mini with CM MOD 5.1.1. Here is a picture of the device i removed: prox sensor I have removed it using a SMD solder station's heat gun at 400 degrees, some tweezers and flux.But a sharp hobby knife might work too.

Cran answered 29/12, 2017 at 16:27 Comment(2)
plus one for ultimate solutionPlashy
update: im now running LineageOS with no issues from the proximity sensor. the exception is that i might have face dialed a couple of times. bug or feature? you decide.Cran
S
7

I also had problem with proximity sensor (I shattered screen in that region on my Nexus 6, Android Marshmallow) and none of proposed solutions / third party apps worked when I tried to disable proximity sensor. What worked for me was to calibrate the sensor using Proximity Sensor Reset/Repair. You have to follow the instruction in app (cover sensor and uncover it) and then restart your phone. Although my sensor is no longer behind the glass, it still showed slightly different results when covered / uncovered and recalibration did the job.

What I tried and didn't work? Proximity Screen Off Lite, Macrodroid and KinScreen.

What would've I tried had it still not worked?[XPOSED] Sensor Disabler, but it requires you to be rooted and have Xposed Framework, so I'm really glad I've found the easier way.

Sestos answered 9/9, 2016 at 18:40 Comment(2)
With proximity recalibration now is all ok.. Thanks!Akel
thanks, calibration worked correctly on Nexus 4 with Android 5. tried Xposed previously, but they are not compatible with lolipop, so this saved my dayCoal
M
6

I found my solution here. Basically use an app called Proximity Screen Off Lite and set it as below:

  1. Screen On/Off Modes Check "Cover and hold to turn on Screen" Timeout: 1 second Check "Disable Accidentla Lock" Timeout: 4 seconds

  2. All settings Check "Disable in Lanscape" Check "Lock phone on screen ON"

  3. [Advanced] Configure Sensore Select sensor: Proximity sensor Value when sensor covered: 0 Value when sensor un-covered: 1

Maintain answered 16/10, 2014 at 19:58 Comment(1)
Doesn't work Nexus5 Android 6. Proximity sensor always shows 0.0. Assume will need a hardware repair?Honeysuckle
G
5

I have been researching this for a while, tested and wrote apps.

If you have no option in Settings → Phone → Use proximity sensor, then the only choice, seem to be to disable or modify its settings in rooted devices.

Also consider, that if you plug the headset, the screen will remain on :D

Glockenspiel answered 22/2, 2016 at 23:28 Comment(2)
@WaiHaLee you may edit the answer and add whatever you want.Glockenspiel
@gio you may enter to google play using the link above, copy and paste the description and then edit the answer judge!Glockenspiel
R
3

If you have LineageOS 7.1.2 (and have root), try this solution from XDA.


After having tried all the solutions proposed here, none of which worked for my Nexus 4 (mako), I found one on XDA that solves the problem with the Android dialer (but not with other apps). Basically I downloaded a recompiled version of the Dialer.apk file, which simply ignores the proximity sensor and behaves in the same way as the stock dialer app does.

Rename /system/priv-app/Dialer/Dialer.apk to something, then place the downloaded file to that folder. After reboot, I had to install the new dialer manually (simply by clicking on it). So now the original app is replaced, and the calls should be handled by this new one.

[Downside: the new way to answer a call is by pulling down the status bar and clicking 'Answer' (or 'Dismiss'), the usual slider is missing. Also, you'll need to repeat this every time your Android updates to a newer version.]

Reaves answered 14/8, 2017 at 9:12 Comment(2)
Or "if you get real desperate, first install lineage then..." :)Goosy
Do you have a link to that recompiled Dialer.apk?Delois
A
2

Unfortunately my proximity sensor doesn't work, too (always returns 0.0 cm). I found the way, but not easy one: you need to root your phone, install XPOSED framework and Sensor Disabler (https://play.google.com/store/apps/details?id=com.mrchandler.disableprox). You can mock proximity sensor return value in the app. (e.g. always return 2.0 cm). Then your display will be always on during the call.

Amin answered 26/9, 2016 at 10:40 Comment(0)
S
1

edit build.prop in folder /system if below line is exist change the value and if not exist add this line and save.(device must be rooted)

ro.lge.proximity.delay=25
mot.proximity.delay=25  
Stephens answered 27/7, 2014 at 15:54 Comment(5)
This changes the delay, right? I'm trying to disable the sensor during calls.Carmella
yes its change delay. i set this delay in my device to 1 so i have not any problem yet.Stephens
causes a bootloop on my xperia z running pacman rom android 4.4Burdett
This didn't work for me on Nexus 6 (shamu) Android 6.0.1.Longmire
what does 1 mean? What does 25 mean?Gristle
E
1

Proximity Sensor Dial

*#*#7378423#*#*

1) Service Tests - (If present)

2) Proximity Switch

3) Test on sensor (Next to logo(top) of mobile)

4) Yes if works, then u can keep on and proximity switch forever which gives beep all the time and consumes lot of battery

OR

4) No it doesn't work - Then simply clean the mobile screen or screen guard and clear the blocked screen from sensor. It works charm.

Technically, Its not any software solution, but hardware solution will work.

Ethyl answered 3/12, 2016 at 4:56 Comment(1)
The last solution is where I ended up - used a compressed gas duster and sprayed into the sensor. That removed the debris and the phone started to function normally.Carmella
G
1

Some more answers from the interwebs: "fix" the sensor (glue screen back on more, or clean it with alcohol, or blow it off with air sent through the headphone jack, tap on it, clean the screen, etc.).

Adjust (after some finding) setting in the "phone" app to disable proximity sensor use. No such setting in mine, that I could find. Proximity Screen Off Lite also didn't work, nor macrodroid.

Another option: root your phone and remove some files:

From root explorer or similar program delete these folders and file
/data/system/sensors
/data/misc/sensors
/persist/sensors/sns.reg

Or if you're truly desperate I suppose a totally different dialer system like TextNow or google hangouts dialer :|

Goosy answered 20/9, 2019 at 18:46 Comment(0)
M
0

Install This call app https://play.google.com/store/apps/details?id=com.goodwy.dialer Go to settings and in call section of settings you can easily disable proximity sensor. enter image description here

Marxism answered 10/7 at 9:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.