mirror of
https://github.com/Evolution-X-Devices/device_google_wahoo
synced 2026-02-01 07:50:47 +00:00
liblight: Change method to get LP mode brightness
am: 98a24a3603
Change-Id: I0c5f7bd69cf66cca7986124dfae53306c2a71b8e
This commit is contained in:
@@ -39,6 +39,8 @@
|
|||||||
#define LIGHTS_SUPPORT_BATTERY 0
|
#define LIGHTS_SUPPORT_BATTERY 0
|
||||||
#define CG_COLOR_ID_PROPERTY "ro.boot.hardware.color"
|
#define CG_COLOR_ID_PROPERTY "ro.boot.hardware.color"
|
||||||
|
|
||||||
|
#define LP_MODE_BRIGHTNESS_PROPERTY "sys.display.low_persistence_mode_brightness"
|
||||||
|
|
||||||
static pthread_once_t g_init = PTHREAD_ONCE_INIT;
|
static pthread_once_t g_init = PTHREAD_ONCE_INIT;
|
||||||
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static struct light_state_t g_notification;
|
static struct light_state_t g_notification;
|
||||||
@@ -195,8 +197,10 @@ set_light_backlight(struct light_device_t* dev,
|
|||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
if (lpEnabled != 0) {
|
if (lpEnabled != 0) {
|
||||||
// This is defined in BoardConfig.mk.
|
// Try to get the brigntess though property, otherwise it will
|
||||||
brightness = DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS;
|
// set the default brightness, which is defined in BoardConfig.mk.
|
||||||
|
brightness = property_get_int32(LP_MODE_BRIGHTNESS_PROPERTY,
|
||||||
|
DEFAULT_LOW_PERSISTENCE_MODE_BRIGHTNESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user