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!

zahypeti
  • 183
  • 1
  • 8
jobinbasani
  • 2,075
  • 6
  • 47
  • 66
  • 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. – initramfs Jul 27 '14 at 15:55
  • Yes,I have set this flag too – jobinbasani Jul 27 '14 at 15:59
  • Get the app Hardware Disabler from Google Play Store Visit https://play.google.com/store/apps/details?id=com.hatcyl.android.Hardware_Disabler&hl=en – my doubts Jul 27 '14 at 15:51
  • 1
    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) – kaefert Apr 18 '15 at 13:41
  • 1
    "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... – Tobias J Jun 01 '15 at 13:32

9 Answers9

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.

DarkPh03n1X
  • 600
  • 1
  • 7
  • 17
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.

tlegutko
  • 698
  • 2
  • 11
  • 16
  • 1
    With proximity recalibration now is all ok.. Thanks! – user3589887 Jun 25 '17 at 07:54
  • 1
    thanks, calibration worked correctly on Nexus 4 with Android 5. tried Xposed previously, but they are not compatible with lolipop, so this saved my day – hoonzis Jan 02 '18 at 10:53
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

fangmobile
  • 839
  • 8
  • 23
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

ncomputers
  • 3,680
  • 1
  • 15
  • 16
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.]

zahypeti
  • 183
  • 1
  • 8
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.

rejthy
  • 446
  • 3
  • 4
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  
Meysam
  • 694
  • 6
  • 20
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.

Surya R Praveen
  • 3,393
  • 1
  • 24
  • 25
  • 4
    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. – jobinbasani Jan 19 '17 at 20:37
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 :|

rogerdpack
  • 62,887
  • 36
  • 269
  • 388