Skip to content

Commit

Permalink
Merge pull request #48 from CyanogenMod/cm-12.1
Browse files Browse the repository at this point in the history
healthd: Add secondary backlight path support
  • Loading branch information
alwaysadeel committed Aug 5, 2015
2 parents 31b7943 + d2d26ff commit 34aa827
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions healthd/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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), \
Expand Down
19 changes: 19 additions & 0 deletions healthd/healthd_mode_charger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 34aa827

Please sign in to comment.