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

I recently decided to replace my frustrating mobile phone (a Samsung Galaxy S phone, the Vibrant) because Samsung and T-Mobile has been terrible at keeping current with the latest version of Android. I did a bit of research on eBay and Craigslist, and found that the myTouch 4G (aka HTC Glacier) was a comparable phone with more memory and faster data speeds.

I spent New Year’s weekend crawling Craigslist trying to find the cheapest MyTouch 4G nearby. I figured it’d be a bit of a calculated risk, but I felt pretty good about it. I found a guy selling one nearby and met up and grabbed up the phone in the parking lot of a nearby McDonald’s. From what I could tell, the phone was in good shape but it had been a little loved.

I took the phone straight home, rooted it and installed my favorite Android ROM, CyanogenMod. It was not until a couple days later that I realized the phone had a quirky problem. Whenever I would receive (or place) a phone call, the screen would immediately go dark and remain dark until I either pulled the battery or received another call (and didn’t answer it).

After about a hundred different searches on Google, I began to suspect that the proximity sensor on the phone was not behaving properly. The proximity sensor’s purpose on phones is to detect how close to your face the phone is. When the phone is right up next to your face, the screen goes dark and does not respond to touch. Once you move the phone away from your face the screen should light back up.

I began by digging around in the CyanogenMod and Android settings. There were some settings that sounded like they might disable or ignore the proximity sensors, but unfortunately they did not quite do the trick for me. Regardless of what I tried, the proximity sensor remained enabled.

I wound up finding an app on the market that I used to troubleshoot the sensor. The name of the app was ‘Proximity Sensor.’ When I opened the app, it told me that the sensor was permanently engaged. Just for fun, I took my flash light and I turned it on and pointed it right at the sensor. When the flashlight was flush up against the phone at it’s brightest setting, the app began to report intermittently that the sensor was clearing.

But if it took a flashlight right up against the phone in order for the sensor to turn off, then surely the sensor is most likely kaput.

Since my phone is rooted, I thought I’d give a few different “fixes” a try. According to some of my research, the HTC’s proximity sensor is a CM3602. In considering options, I thought we’d have a few options:

  1. Deny all permissions on the CM3602 file in the /dev/ folder.
  2. Use an application like Tasker or Proximity Screen Off to disable the sensor.
  3. Switch to the MIUI ROM since it has an option to disable the proximity sensor.

Ultimately, setting the permissions had no effect. Tasker could read the sensor but could not disable it and the Proximity Screen Off app seemed a little convoluted to use. I briefly tried out the MIUI ROM, which fixed the issue. But, I have grown pretty accustomed to CyanogenMod and it was hard to give that up.

Ultimately, 8 or 9 pages deep into Google’s search results was a suggestion to hex edit file and overwrite information about the sensor. Because I was determined to make CyanogenMod work on the phone, I decided to give it a shot. Within the file, /system/lib/hw/, I searched for and overwrote the “cm3602” text with “xxxxxx” and then rebooted the phone.

Because I flashed a different ROM a few months later and a few people had asked for more specific directions, I went ahead and wrote these directions:

  1. Get ADB Functioning on your desktop computer.
  2. Download and install a Hex Editor
  3. Use ADB to pull down the file (adb pull /system/lib/hw/
  4. Open 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 /system/lib/hw/
  8. Reboot your phone.

Thankfully it worked the proximity sensor is disabled on my phone and I am able to make phone calls without causing my phone’s display to turn off indefinitely. This was confirmed by the Proximity Sensor app, which indicates now that there’s an error while trying to read sensor data. This basically turned my dysfunctional phone into something that I could continue to use until my contract runs out and I can upgrade my phone to something with native support for Ice Cream Sandwich in a few months.

According to Google, people frequently have problems with the proximity sensor; people do not seem to like them, they seem to be interfered with by screen protectors and phone cases, and then in a lot of instances, probably mine, people drop their phones and damage the proximity sensor.

I’ve posted this online in both on XDA Forums and in the CyanogenMod forums. And now, it’s forever preserved on my blog. Hopefully, someday down the road it’ll help a few other people out.