["Xiaoyang Yu (Max)" <[email protected]>] > > Current Android code for backlight adjustment do not work properly for > systems other than G1. This is mainly because: > > 1) The corresponding sysfs file changed. In "mydroid/hardware/ > libhardware/power/power.c", LCD_BACKLIGHT is hard coded to "/sys/class/ > leds/lcd-backlight/brightness". While it should be "/sys/class/ > backlight/eeepc/backlight/brightness" for Eee PC. > > 2) The backlight range is assumed to be from 0 - 255 as in "mydroid/ > packages/apps/Settings/src/com/android/settings/ > BrightnessPreference.java". While it should be from 0 - 7 for Eee PC. > > For 1), we can use a property to set the value for the LCD_BACKLIGHT, > instead of hard code it. > For 2), we can check sysfs file "max_brightness" to get the max > backlight level.
I'd prefer that we not use system properties for things that are static build configurations, not likely to change at runtime. Right now there's some abuse of properties along this line, which I'm hoping to address in the future, but for the time being, it's best to avoid adding more properties. It might not be unreasonable to have the generic power code check for /sys/class/backlight/... (scan, not look for hardcoded names like eeepc) and if it doesn't find something there, see if there's a /sys/class/leds/lcd-backlight/... Picking up the max value from sysfs seems like the way to go. Brian --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
