Open phhusson opened 5 years ago
framework-res.zip, used to work for phhusson/vendor_hardware_overlay#32
I found some xiaomi models defined 12-bit lights on framework-res.apk, such as <integer name="config_backlightBits">12</integer>
, but jasmine and daisy don't define it due to Android One models.
framework-res.apk(whyred)/res/values/integer.xml (line20-30):
<integer name="config_autobrightness_darkest_ratio">3</integer>
<integer name="config_autobrightness_highest_lux">4000</integer>
<integer name="config_automatic_brightness_fov">60</integer>
<integer name="config_automatic_brightness_highangle_threshold">70</integer>
<integer name="config_automatic_brightness_skipdebounce">2000</integer>
<integer name="config_backPanicBehavior">0</integer>
<integer name="config_backlightBits">12</integer>
<integer name="config_bluetooth_idle_cur_ma">1</integer>
<integer name="config_bluetooth_max_advertisers">0</integer>
<integer name="config_bluetooth_max_scan_filters">0</integer>
<integer name="config_bluetooth_operating_voltage_mv">3300</integer>
framework-res.apk(wayne)/res/values/integer.xml (line20-30):
<integer name="config_autobrightness_darkest_ratio">3</integer>
<integer name="config_autobrightness_highest_lux">4000</integer>
<integer name="config_automatic_brightness_fov">60</integer>
<integer name="config_automatic_brightness_highangle_threshold">70</integer>
<integer name="config_automatic_brightness_skipdebounce">2000</integer>
<integer name="config_backPanicBehavior">0</integer>
<integer name="config_backlightBits">12</integer>
<integer name="config_bluetooth_idle_cur_ma">1</integer>
<integer name="config_bluetooth_max_advertisers">0</integer>
<integer name="config_bluetooth_max_scan_filters">0</integer>
<integer name="config_bluetooth_operating_voltage_mv">3300</integer>
framework-res.apk(sakura)/res/values/integer.xml (line30-40):
<integer name="config_automatic_brightness_touchbottom">2160</integer>
<integer name="config_automatic_brightness_touchleft">100</integer>
<integer name="config_automatic_brightness_touchright">1000</integer>
<integer name="config_automatic_brightness_touchtop">100</integer>
<integer name="config_backPanicBehavior">0</integer>
<integer name="config_backlightBits">12</integer>
<integer name="config_bluetooth_idle_cur_ma">1</integer>
<integer name="config_bluetooth_max_advertisers">0</integer>
<integer name="config_bluetooth_max_scan_filters">0</integer>
<integer name="config_bluetooth_operating_voltage_mv">3300</integer>
<integer name="config_bluetooth_rx_cur_ma">2</integer>
framework-res.apk(nitrogen)/res/values/integer.xml (line30-40):
<integer name="config_autobrightness_darkest_ratio">3</integer>
<integer name="config_autobrightness_highest_lux">4000</integer>
<integer name="config_automatic_brightness_fov">60</integer>
<integer name="config_automatic_brightness_highangle_threshold">70</integer>
<integer name="config_automatic_brightness_skipdebounce">2000</integer>
<integer name="config_backPanicBehavior">0</integer>
<integer name="config_backlightBits">12</integer>
<integer name="config_bluetooth_idle_cur_ma">1</integer>
<integer name="config_bluetooth_max_advertisers">0</integer>
<integer name="config_bluetooth_max_scan_filters">0</integer>
<integer name="config_bluetooth_operating_voltage_mv">3300</integer>
On devices with more than standard 8 bit brightness levels, the minimum is totally off.
This is because the computation is a direct scaling: https://github.com/phhusson/platform_frameworks_base/blob/83f60d615b7e653b0b74c74f55efa71fff0cf952/services/core/java/com/android/server/lights/LightsService.java#L78 https://github.com/phhusson/platform_frameworks_base/blob/83f60d615b7e653b0b74c74f55efa71fff0cf952/services/core/java/com/android/server/lights/LightsService.java#L62
I'm not too sure what framework-res' min brightness contains in such cases, whether it is unscaled value, scaled value, or neither of those, this needs to be investigated to have proper minimum brightness.