diff --git a/healthd/Android.mk b/healthd/Android.mk index 71fd8f367e2..cd2f1705781 100644 --- a/healthd/Android.mk +++ b/healthd/Android.mk @@ -36,6 +36,7 @@ HEALTHD_CHARGER_DEFINES := RED_LED_PATH \ GREEN_LED_PATH \ BLUE_LED_PATH \ BACKLIGHT_PATH \ + SECONDARY_BACKLIGHT_PATH \ CHARGING_ENABLED_PATH $(foreach healthd_charger_define,$(HEALTHD_CHARGER_DEFINES), \ diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index 75f001d0216..4e6586d0fa5 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -289,6 +289,25 @@ static int set_backlight(bool on) } close(fd); +#ifdef SECONDARY_BACKLIGHT_PATH + if (access(SECONDARY_BACKLIGHT_PATH, R_OK | W_OK) != 0) + { + LOGW("Secondary Backlight control not support\n"); + return 0; + } + + fd = open(SECONDARY_BACKLIGHT_PATH, O_RDWR); + if (fd < 0) { + LOGE("Could not open secondary backlight node : %s\n", strerror(errno)); + return 0; + } + LOGV("Enabling secondary backlight\n"); + if (write(fd, buffer,strlen(buffer)) < 0) { + LOGE("Could not write to secondary backlight node : %s\n", strerror(errno)); + } + close(fd); +#endif + return 0; }