diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:47 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 17:39:47 -0700 |
commit | e18b7b21c2fe0788e6cf1a1a055a25c2e5bc2dd8 (patch) | |
tree | ce03b1f9eb82ccd79bec81c1a0bb035b38df70f5 /power | |
parent | ec19f1e4f0f46544b0901f642cc4cbe1e42010d4 (diff) | |
download | hardware_libhardware_legacy-e18b7b21c2fe0788e6cf1a1a055a25c2e5bc2dd8.zip hardware_libhardware_legacy-e18b7b21c2fe0788e6cf1a1a055a25c2e5bc2dd8.tar.gz hardware_libhardware_legacy-e18b7b21c2fe0788e6cf1a1a055a25c2e5bc2dd8.tar.bz2 |
auto import from //branches/cupcake_rel/...@140373
Diffstat (limited to 'power')
-rw-r--r-- | power/power.c | 52 | ||||
-rw-r--r-- | power/power_qemu.c | 23 | ||||
-rw-r--r-- | power/power_qemu.h | 3 |
3 files changed, 0 insertions, 78 deletions
diff --git a/power/power.c b/power/power.c index 1130dfa..0309db7 100644 --- a/power/power.c +++ b/power/power.c @@ -56,10 +56,6 @@ const char * const NEW_PATHS[] = { const char * const AUTO_OFF_TIMEOUT_DEV = "/sys/android_power/auto_off_timeout"; -const char * const LCD_BACKLIGHT = "/sys/class/leds/lcd-backlight/brightness"; -const char * const BUTTON_BACKLIGHT = "/sys/class/leds/button-backlight/brightness"; -const char * const KEYBOARD_BACKLIGHT = "/sys/class/leds/keyboard-backlight/brightness"; - //XXX static pthread_once_t g_initialized = THREAD_ONCE_INIT; static int g_initialized = 0; static int g_fds[OUR_FD_COUNT]; @@ -162,54 +158,6 @@ set_last_user_activity_timeout(int64_t delay) } } -static void -set_a_light(const char* path, int value) -{ - int fd; - static int already_warned = 0; - - // LOGI("set_a_light(%s, %d)\n", path, value); - - fd = open(path, O_RDWR); - if (fd >= 0) { - char buffer[20]; - int bytes = sprintf(buffer, "%d\n", value); - write(fd, buffer, bytes); - close(fd); - } else { - if (already_warned == 0) { - LOGE("set_a_light failed to open %s\n", path); - already_warned = 1; - } - } -} - -int -set_light_brightness(unsigned int mask, unsigned int brightness) -{ - QEMU_FALLBACK(set_light_brightness(mask,brightness)); - - initialize_fds(); - -// LOGI("set_light_brightness mask=0x%08x brightness=%d now=%lld g_error=%s\n", -// mask, brightness, systemTime(), strerror(g_error)); - - if (mask & KEYBOARD_LIGHT) { - set_a_light(KEYBOARD_BACKLIGHT, brightness); - } - - if (mask & SCREEN_LIGHT) { - set_a_light(LCD_BACKLIGHT, brightness); - } - - if (mask & BUTTON_LIGHT) { - set_a_light(BUTTON_BACKLIGHT, brightness); - } - - return 0; -} - - int set_screen_state(int on) { diff --git a/power/power_qemu.c b/power/power_qemu.c index d400082..742276f 100644 --- a/power/power_qemu.c +++ b/power/power_qemu.c @@ -19,29 +19,6 @@ #include <errno.h> #include <hardware_legacy/power.h> -static void -set_a_light(const char* name, unsigned brightness) -{ - qemu_control_command( "power:light:brightness:%s:%d", - name, brightness ); -} - -int -qemu_set_light_brightness(unsigned int mask, unsigned int brightness) -{ - if (mask & KEYBOARD_LIGHT) { - set_a_light("keyboard_backlight", brightness); - } - if (mask & SCREEN_LIGHT) { - set_a_light("lcd_backlight", brightness); - } - if (mask & BUTTON_LIGHT) { - set_a_light("button_backlight", brightness); - } - return 0; -} - - int qemu_set_screen_state(int on) { diff --git a/power/power_qemu.h b/power/power_qemu.h index 3004950..c689da3 100644 --- a/power/power_qemu.h +++ b/power/power_qemu.h @@ -19,9 +19,6 @@ #include <stdint.h> extern int -qemu_set_light_brightness(unsigned int mask, unsigned int brightness); - -extern int qemu_set_screen_state(int on); #endif /* _power_qemu_h */ |