Remove All Ads from XDA
Find Your Device:
Or Continue to Thread: [INFO/FAQ] Unofficial Cyanogen…
23rd May 2011, 04:33 PM |#19484  
Senior Member
Thanks Meter: 622
Light sensor fixup
I have been working on fixing up the light sensor readings and I need somebody to test the results. Once I hear it is working for others I will submit it to Gerrit.

What this does: fixes light sensor values reported to the system
What this doesn't do: adjust any of the ranges that trigger the ranges or the screen brightness values (you have to use the custom light levels until I submit that fix)

The kernel driver has the light level values as follows:

3, 7, 12, 57, 114, 279, 366, 453, 540, 1023

Switched these values in place of the ones in LightSensor.cpp and a couple of other changes.

Now I am getting the full range of readings. The Upper light sensor levels (in Cyanogenmod settings > Display > Automatic Backlight > Use custom , Edit other levels) still need to be adjusted to the above levels, then you can customize the screen and button brightness to your desire.

Here is a zip that can be flashed or you can extract the file /system/lib/hw/ to the same directory on the phone using root explorer or adb.

As far as I can tell it should work with stable CM7 and most gingerbread roms.
Attached Files
File Type: zip - [Click for QR Code] (132.1 KB, 28 views)
The Following User Says Thank You to sbradymobile For This Useful Post: [ View ] Gift sbradymobile Ad-Free