Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,730,529 Members 40,306 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Wonky Proximity Sensor?

Tip us?
 
Neckhole
Old
(Last edited by Neckhole; 6th January 2012 at 11:32 PM.)
#1  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
Default [Q] Wonky Proximity Sensor?

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 android@portatile #1
  • Mod Version: CyanogenMod-7.2.0-RC0-glacier-KANG
  • Build Number: GWK74

Thanks in advance for taking a look
 
estallings15
Old
(Last edited by estallings15; 7th January 2012 at 03:01 AM.)
#2  
estallings15's Avatar
Senior Member
Thanks Meter 2590
Posts: 5,998
Join Date: Apr 2011
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
If you've helped me I'll be sure and hit the "Thanks" button. Please do the same for me!

Proud owner of a Nexus 4 5
and a myTouch 4G
 
Neckhole
Old
#3  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
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
The Following User Says Thank You to Neckhole For This Useful Post: [ Click to Expand ]
 
Neckhole
Old
#4  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
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.
The Following User Says Thank You to Neckhole For This Useful Post: [ Click to Expand ]
 
daxecutioner24
Old
#5  
daxecutioner24's Avatar
Senior Member
Thanks Meter 108
Posts: 858
Join Date: Jun 2011
Thanks for comments mines also have this issue too.

Sent from my HTC Glacier using XDA App
 
estallings15
Old
#6  
estallings15's Avatar
Senior Member
Thanks Meter 2590
Posts: 5,998
Join Date: Apr 2011
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
If you've helped me I'll be sure and hit the "Thanks" button. Please do the same for me!

Proud owner of a Nexus 4 5
and a myTouch 4G
 
daxecutioner24
Old
#7  
daxecutioner24's Avatar
Senior Member
Thanks Meter 108
Posts: 858
Join Date: Jun 2011
Quote:
Originally Posted by estallings15 View Post
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
The Following User Says Thank You to daxecutioner24 For This Useful Post: [ Click to Expand ]
 
Neckhole
Old
#8  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
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
The Following User Says Thank You to Neckhole For This Useful Post: [ Click to Expand ]
 
Neckhole
Old
#9  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
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/m...ose-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.
The Following 3 Users Say Thank You to Neckhole For This Useful Post: [ Click to Expand ]
 
Neckhole
Old
#10  
Member - OP
Thanks Meter 18
Posts: 52
Join Date: Mar 2010
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.

The Following User Says Thank You to Neckhole For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes