mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-01 07:47:55 +00:00
liblights: Always apply linear scaling if max brightness isn't 255
* As of now the code account only max_brightness > 255 -> Check if max_brightness != 255 and apply the scaling even if the max_brightness is less then 255 Change-Id: I809ece5844c8ccf20ae6507f23d308fe3ddfe94b
This commit is contained in:
parent
3c99507fb6
commit
a042209f66
1 changed files with 3 additions and 3 deletions
|
@ -122,10 +122,10 @@ static int set_light_backlight(struct light_device_t *dev __unused,
|
|||
int max_brightness = g_backlight.max_brightness;
|
||||
|
||||
/*
|
||||
* If our max panel brightness is > 255, apply linear scaling across the
|
||||
* accepted range.
|
||||
* If max panel brightness is not the default (255),
|
||||
* apply linear scaling across the accepted range.
|
||||
*/
|
||||
if (max_brightness > MAX_INPUT_BRIGHTNESS) {
|
||||
if (max_brightness != MAX_INPUT_BRIGHTNESS) {
|
||||
int old_brightness = brightness;
|
||||
brightness = brightness * max_brightness / MAX_INPUT_BRIGHTNESS;
|
||||
ALOGV("%s: scaling brightness %d => %d", __func__,
|
||||
|
|
Loading…
Reference in a new issue