diff options
author | Gary D <garyd9@gmail.com> | 2012-06-28 05:05:36 -0400 |
---|---|---|
committer | Gary D <garyd9@gmail.com> | 2012-06-28 05:05:36 -0400 |
commit | 679d203f63c9c6c64825b2df0b0f005e4aaaeee4 (patch) | |
tree | 386f7ca68668c184d50247f77c234f5707087395 | |
parent | f2d31f2429158e5d7e62264e302a28cea327a5f1 (diff) | |
download | android_hardware_samsung-679d203f63c9c6c64825b2df0b0f005e4aaaeee4.tar.gz android_hardware_samsung-679d203f63c9c6c64825b2df0b0f005e4aaaeee4.tar.bz2 android_hardware_samsung-679d203f63c9c6c64825b2df0b0f005e4aaaeee4.zip |
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>
-rw-r--r-- | exynos4/exynos4x12/liblights/lights.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/exynos4/exynos4x12/liblights/lights.c b/exynos4/exynos4x12/liblights/lights.c index 43801ff..de2f653 100644 --- a/exynos4/exynos4x12/liblights/lights.c +++ b/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; |