mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_rosemary
synced 2026-01-27 13:35:09 +00:00
rosemary: lights: Adapt brightness scaling behaviour to match MIUI
MIUI's lowest brightness value is '19' and using lower values can cause the backlight to completely power off inadvertedly Therefore, let's just account for this behaviour in the light AIDL by adding '19' instead of '1' to the final brightness value Signed-off-by: LinkBoi00 <linkdevel@protonmail.com> Change-Id: I0e31bda9a0cc505f1246209810eae624dfe5d068
This commit is contained in:
committed by
Matsvei Niaverau
parent
4afebee430
commit
6ce8341120
@@ -86,7 +86,7 @@ static inline uint32_t scaleBrightness(uint32_t brightness, uint32_t maxBrightne
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (brightness - 1) * (maxBrightness - 1) / (0xFF - 1) + 1;
|
||||
return (brightness - 1) * (maxBrightness - 19) / (0xFF - 1) + 19;
|
||||
}
|
||||
|
||||
static inline uint32_t getScaledBrightness(const HwLightState& state, uint32_t maxBrightness) {
|
||||
|
||||
Reference in New Issue
Block a user