Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

healthd: Add secondary backlight path support #48

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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