fix keypad lighting up when screen backlight auto-adjusts

If the screen backlight was already lit and is just changing brightness,
don't blindly illuminate the keypad

Change-Id: If7473eb57aa4d48bc98a4bb42b9becc80764b1f8
Signed-off-by: Gary D <garyd9@gmail.com>
tirimbino
Gary D 13 years ago
parent f2d31f2429
commit 679d203f63
  1. 6
      exynos4/exynos4x12/liblights/lights.c

@ -126,11 +126,15 @@ static int set_light_backlight(struct light_device_t *dev,
struct light_state_t const *state)
{
int err = 0;
status int s_previous_brightness = -1;
int brightness = rgb_to_brightness(state);
pthread_mutex_lock(&g_lock);
err = write_int(PANEL_FILE, brightness);
err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 2);
if (!s_previous_brightness && (brightness > 0)) {
err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 2);
s_previous_brightness = brightness;
}
pthread_mutex_unlock(&g_lock);
return err;

Loading…
Cancel
Save