«

Android4.4 背光亮度最低设置

时间:2024-3-2 17:10     作者:韩俊     分类: Android


在android中可能出现这样一种不友好的现象,当用户选择自动调整屏幕亮度或者将屏幕亮度调整为最小时,系统整个屏幕都黑了。

完全不知道这么解决?

有两种解决办法:

1. 在android中设置用户能够设置的最低亮度。

diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml
index b069be3..3ea6643 100755
--- a/frameworks/base/core/res/res/values/config.xml
+++ b/frameworks/base/core/res/res/values/config.xml
@@ -651,7 +651,7 @@

     <!-- Minimum screen brightness setting allowed by the power manager.
          The user is forbidden from setting the brightness below this level. -->
-    <integer name="config_screenBrightnessSettingMinimum">10</integer>
+    <integer name="config_screenBrightnessSettingMinimum">20</integer>

     <!-- Maximum screen brightness allowed by the power manager.
          The user is forbidden from setting the brightness above this level. -->
@@ -664,7 +664,7 @@
     <!-- Screen brightness used to dim the screen when the user activity
          timeout expires.  May be less than the minimum allowed brightness setting
          that can be set by the user. -->
-    <integer name="config_screenBrightnessDim">10</integer>
+    <integer name="config_screenBrightnessDim">20</integer>

     <!-- Array of output values for LCD backlight corresponding to the LUX values
          in the config_autoBrightnessLevels array.  This array should have size one greater


2. 在内核中,设置最低的亮度。

diff --git a/kernel/drivers/leds/leds-qpnp.c b/kernel/drivers/leds/leds-qpnp.c
index 5a492c8..995ff1a 100644
--- a/kernel/drivers/leds/leds-qpnp.c
+++ b/kernel/drivers/leds/leds-qpnp.c
@@ -1398,6 +1398,8 @@ static void qpnp_led_set(struct led_classdev *led_cdev,

        if (value > led->cdev.max_brightness)
                value = led->cdev.max_brightness;
+       else if (value < 10)
+           value = 10 ;

        led->cdev.brightness = value;
        schedule_work(&led->work);



标签: android

热门推荐