• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Q] Wonky Proximity Sensor?

Search This thread

Neckhole

Senior Member
Mar 12, 2010
52
19
Hey guys,

I've bought a slightly used myTouch 4G off of Craigslist to replace my Vibrant.

I've rooted and modded the MT4G and I'm currently running CM 7.2 RC0. I followed the step-by-step directions from the CM Wiki.


I've found what I think is a problematic proximity sensor reading. Every time I place or receive a phone call, the screen blanks out. The only way I've found to bring the device back, is to wait for the phone call to disconnect and then receive another incoming call. This _usually_ will reactivate the display. As long as I don't answer that phone call, the display will remain active.

I downloaded a proximity sensor app off of the market and according to the app the proximity sensor is engaged 100% of the time (which explains the behavior a little bit). But I don't know whether or not to trust this app.

I've tried tinkering with every proximity setting I can find, both in the phone's settings and in the extra settings that CM ships with.

Edit: I'm sorry for not mentioning it earlier, but I have done a bit of research on the proximity sensor. I don't think there's any kind of screen protector that might be obscuring the sensor.


What are the chances that the phone's proximity sensor is damaged? Is there any way to spoof that value and override what the sensor is repeating back to the OS?

Does anyone have any helpful suggestions?

For what it's worth, here's some information from About Phone:
  • Android Version: 2.3.7
  • Baseband Version: 12.28b.60.140eU_26.03.02.26_M
  • Kernel Version: 2.6.35.14-cyanogenmod-g295e82f [email protected] #1
  • Mod Version: CyanogenMod-7.2.0-RC0-glacier-KANG
  • Build Number: GWK74

Thanks in advance for taking a look ;)
 
Last edited:

estallings15

Senior Member
Apr 22, 2011
6,201
2,547
Are you using a case? My wife bought a cheap case that covered the prox sensor and it behaved exactly how you said.

Edit: I found an app in the market called Hardware Disabler. It scans your device for drivers and disables whatever you select. The problem is it only gives you the driver's name, not what it works for. If you can identify the driver (perhaps a knowledgable dev could help) you could kill that baby on startup.
Sent from my HTC Glacier using XDA App
 
Last edited:

Neckhole

Senior Member
Mar 12, 2010
52
19
Yeah, sorry I didn't mention it before. I've got nothing that I can think of that would be interfering with the proximity sensor on the front of the phone; no screen protector, no little case. Nothing at all.

Tonight I've been monkeying around with a few different things, just to see if I got better/different results:

  • Tried a couple of the different/newer radios from the radios post in the dev forum.
  • Wiped cache and Davlik partition
  • Reset phone back to factory defaults.
  • Flashed back to one of the T-Mobile Froyo ROMs.

None of these helped, but on a lark. I decided to go ahead and shine a big flash light at the phone while I was running the Proximity Sensor Finder application. If I shined the light directly on the proximity sensor, then the proximity sensor would intermittently blink on/off.

It doesn't really help me all that much, but it looks like I definitely have a flaky/bad proximity sensor.

In order to help people down the road who might have the same problem, here's some things I'm going to try:

  1. Deny permissions to the device's file in the /dev directory
  2. Try and use an app like Tasker to disable the sensor.
  3. May flash MIUI, it sounds like it has an option to permanently disable the proximity sensor.
  4. An app on the market called Proximity Screen Off

I'll keep the thread up-to-date with what I wound up doing. It's a bit of a bummer, I got this phone to last me until my contract expires with T-Mobile in a few months. But it was hopefully going to be a definite upgrade over the Vibrant. It's a little aggravating that I'm going to spend the next few months heating the side of my face when I'm on the phone and/or accidentally hanging up on people when on the phone ;)
 
  • Like
Reactions: r0mmel

Neckhole

Senior Member
Mar 12, 2010
52
19
Last reply to my own thread, I promise. The MIUI's disable proximity sensor setting worked great, although I wasn't really crazy about the look & feel of MIUI (this isn't a dig on the ROM, just a personal preference).

We wound up using a Hex Editor to edit the file /system/lib/hw/sensors.glacier.so, we searched for "cm3602" (the proximity sensor) and changed it to "xxxxxx".

The one downside is the phone doesn't turn off when you hold it up to your face, but that's certainly better than a phone who's display likes to power off when placing/receiving phone calls.
 
  • Like
Reactions: r0mmel

estallings15

Senior Member
Apr 22, 2011
6,201
2,547
Nice thread Neckhole. I'm glad you followed up on this and let us know what did and did not work for you. Thanks. I really hate it when people figure something out and never post it. Ha.

Sent from my HTC Glacier using XDA App
 

Neckhole

Senior Member
Mar 12, 2010
52
19
Just a quick update, I've been re-flashing different ROMs and had to re-make this change. Which helped me spot some typos in my blog post (woops) and I took the time to write something more close to step-by-step instructions. Hope this is more helpful:

http://blog.brianmoses.net/2012/01/mytouch-4g-dont-stand-so-close-to-me.html

  1. Get ADB Functioning on your desktop computer.
  2. Download and install a Hex Editor
  3. Use ADB to pull down the file sensors.glacier.so (adb pull /system/lib/hw/sensors.glacier.so)
  4. Open sensors.glacier.so in your Hex Editor
  5. Search for the text "cm3602" (no double-quotes) and save your changes. Please note, case sensitivity is important. If you're paranoid, it's good to check that the file size is exactly the same as it was before your edit.
  6. Re-mount the /System folder as read-write using an ADB Shell (mount -o remount,rw /dev/block/mmcblk0p25 /system)
  7. Open up a new command window and use ADB to push your edited file (adb push sensors.glacier.so /system/lib/hw/sensors.glacier.so)
  8. Reboot your phone.
 

Neckhole

Senior Member
Mar 12, 2010
52
19
For whatever it's worth, I flashed my first ICS ROM a week or two ago. I totally forgot about my defective Proximity Sensor.

I thought people might like to know that the same steps I used to disable the proximity sensor previously still works in ICS.
 
  • Like
Reactions: r0mmel

r0mmel

Senior Member
May 12, 2006
78
5
thank you thank you thank you for this thread, i have the exact same problem i couldnt answer calls cause i use gv and i cant call where i have to press a number aftewards!
so glad it still works for ics. thank you again! posted this problem in a few forums no one could help
 

tripi24

New member
Dec 17, 2011
1
0
I have a doubt

You said : Search for the text "cm3602" (no double-quotes) and save your changes

what changes should I save? since all I've done is search for a text.
 

BobZombiE

Member
May 1, 2012
44
15
I have the exact same problem after recently i replaced my broken digitizer touch screen & LCD.
I just realized that during the call , when the display goes totally black , if i push the UP-LEFT corner of the screen of my phone (just beside the proximity sensor) , the screen comes back again.
That's because the "adhesive" i used under the lcd screen , is more thicker than the original adhesive.
So the sensor is ok , the distant between the "touch & LCD " and the sensor is the problem.
 

BobZombiE

Member
May 1, 2012
44
15
Solved

Well i again diss-assembled the whole phone , and replace the thick adhesive under the Lcd & touch with proper one.
and problem solved as i guessed it's not from the Proximity sensor . no more dark screen :D
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Just a quick update, I've been re-flashing different ROMs and had to re-make this change. Which helped me spot some typos in my blog post (woops) and I took the time to write something more close to step-by-step instructions. Hope this is more helpful:

    http://blog.brianmoses.net/2012/01/mytouch-4g-dont-stand-so-close-to-me.html

    1. Get ADB Functioning on your desktop computer.
    2. Download and install a Hex Editor
    3. Use ADB to pull down the file sensors.glacier.so (adb pull /system/lib/hw/sensors.glacier.so)
    4. Open sensors.glacier.so in your Hex Editor
    5. Search for the text "cm3602" (no double-quotes) and save your changes. Please note, case sensitivity is important. If you're paranoid, it's good to check that the file size is exactly the same as it was before your edit.
    6. Re-mount the /System folder as read-write using an ADB Shell (mount -o remount,rw /dev/block/mmcblk0p25 /system)
    7. Open up a new command window and use ADB to push your edited file (adb push sensors.glacier.so /system/lib/hw/sensors.glacier.so)
    8. Reboot your phone.
    1
    Yeah, sorry I didn't mention it before. I've got nothing that I can think of that would be interfering with the proximity sensor on the front of the phone; no screen protector, no little case. Nothing at all.

    Tonight I've been monkeying around with a few different things, just to see if I got better/different results:

    • Tried a couple of the different/newer radios from the radios post in the dev forum.
    • Wiped cache and Davlik partition
    • Reset phone back to factory defaults.
    • Flashed back to one of the T-Mobile Froyo ROMs.

    None of these helped, but on a lark. I decided to go ahead and shine a big flash light at the phone while I was running the Proximity Sensor Finder application. If I shined the light directly on the proximity sensor, then the proximity sensor would intermittently blink on/off.

    It doesn't really help me all that much, but it looks like I definitely have a flaky/bad proximity sensor.

    In order to help people down the road who might have the same problem, here's some things I'm going to try:

    1. Deny permissions to the device's file in the /dev directory
    2. Try and use an app like Tasker to disable the sensor.
    3. May flash MIUI, it sounds like it has an option to permanently disable the proximity sensor.
    4. An app on the market called Proximity Screen Off

    I'll keep the thread up-to-date with what I wound up doing. It's a bit of a bummer, I got this phone to last me until my contract expires with T-Mobile in a few months. But it was hopefully going to be a definite upgrade over the Vibrant. It's a little aggravating that I'm going to spend the next few months heating the side of my face when I'm on the phone and/or accidentally hanging up on people when on the phone ;)
    1
    Last reply to my own thread, I promise. The MIUI's disable proximity sensor setting worked great, although I wasn't really crazy about the look & feel of MIUI (this isn't a dig on the ROM, just a personal preference).

    We wound up using a Hex Editor to edit the file /system/lib/hw/sensors.glacier.so, we searched for "cm3602" (the proximity sensor) and changed it to "xxxxxx".

    The one downside is the phone doesn't turn off when you hold it up to your face, but that's certainly better than a phone who's display likes to power off when placing/receiving phone calls.
    1
    Nice thread Neckhole. I'm glad you followed up on this and let us know what did and did not work for you. Thanks. I really hate it when people figure something out and never post it. Ha.

    Me too lol
    Sent from my HTC Glacier using XDA App



    Sent from my HTC Glacier using XDA App
    1
    I'm glad what I found out has helped you guys too, I posted a blog about it too after a few people found it to be helpful.

    MyTouch 4G: Don't Stand So Close to Me