Skip to content
Snippets Groups Projects
Commit 33a88ec8 authored by Chenyang Zhong's avatar Chenyang Zhong Committed by FlowerSea0208
Browse files

mars: overlay: also set config_screenBrightnessDozeFloat

The PowerManagerService reads config_screenBrightnessDozeFloat first
and later falls back to config_screenBrightnessDim if the float
value is INVALID_BRIGHTNESS_IN_CONFIG [1]. The problem is that
config_screenBrightnessDozeFloat is set to 0.0 by default on the
frameworks side [2], so it will never be INVALID_BRIGHTNESS_IN_CONFIG.

As a result, mScreenBrightnessDoze is always initialized to 0.0f
if the device does not set config_screenBrightnessDozeFloat in an
overlay, which then causes BRIGHTNESS_CONSTRAINT_TYPE_DOZE to
always return 0.0f.

To prevent other framework components from getting an incorrect
doze config value, set this float in overlay as well.

[1] https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-12.1.0_r10/services/core/java/com/android/server/power/PowerManagerService.java#991
[2] https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-12.1.0_r10/core/res/res/values/config.xml#1333



Change-Id: If79a05c167aff39b38e234fea906cb7bbeed6381
Signed-off-by: default avatarChenyang Zhong <zhongcy95@gmail.com>
parent 37b2a4ec
No related branches found
No related tags found
No related merge requests found
...@@ -393,6 +393,8 @@ ...@@ -393,6 +393,8 @@
May be less than the minimum allowed brightness setting May be less than the minimum allowed brightness setting
that can be set by the user. --> that can be set by the user. -->
<integer name="config_screenBrightnessDoze">17</integer> <integer name="config_screenBrightnessDoze">17</integer>
<!-- 16/254 = 0.06299212598 -->
<item name="config_screenBrightnessDozeFloat" format="float" type="dimen">0.062992</item>
<!-- Screen brightness used to dim the screen when the user activity <!-- Screen brightness used to dim the screen when the user activity
timeout expires. May be less than the minimum allowed brightness setting timeout expires. May be less than the minimum allowed brightness setting
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment