mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
liblights: Add support for variable touchkey brightness
Change-Id: Icc5c589e88dc342ae50b432187bae65a9b3a23d7
This commit is contained in:
parent
63b5bd7d6b
commit
d81a0a3b06
2 changed files with 8 additions and 4 deletions
|
@ -30,6 +30,9 @@
|
|||
#define BUTTON_BRIGHTNESS_NODE "/sys/class/sec/sec_touchkey/brightness"
|
||||
#define LED_BLINK_NODE "/sys/class/sec/led/led_blink"
|
||||
|
||||
// Set to 1 to enable variable button brightness
|
||||
#define VAR_BUTTON_BRIGHTNESS 0
|
||||
|
||||
/*
|
||||
* Brightness adjustment factors
|
||||
*
|
||||
|
|
|
@ -145,12 +145,13 @@ static int set_light_buttons(struct light_device_t* dev __unused,
|
|||
struct light_state_t const* state)
|
||||
{
|
||||
int err = 0;
|
||||
int on = (state->color & COLOR_MASK);
|
||||
|
||||
pthread_mutex_lock(&g_lock);
|
||||
int brightness = (state->color & COLOR_MASK) ? 1 : 0;
|
||||
|
||||
err = set_cur_button_brightness(on ? 1 : 0);
|
||||
|
||||
#ifdef VAR_BUTTON_BRIGHTNESS
|
||||
brightness = rgb_to_brightness(state);
|
||||
#endif
|
||||
err = set_cur_button_brightness(brightness);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
|
||||
return err;
|
||||
|
|
Loading…
Reference in a new issue