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:
LinkBoi00
2022-08-14 00:23:54 +03:00
committed by Matsvei Niaverau
parent 4afebee430
commit 6ce8341120

View File

@@ -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) {