Skip to content

Commit

Permalink
healthd: Add secondary backlight path support
Browse files Browse the repository at this point in the history
Some devices require two backlight brightness
paths to turn off the screen.

Change-Id: Ibf2ee853657c602158af219de0ba132f29dc4571
Signed-off-by: Mrcl1450 <[email protected]>
  • Loading branch information
Mrcl1450 authored and Gerrit Code Review committed Jul 30, 2015
1 parent 4988584 commit d2d26ff
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 d2d26ff

Please sign in to comment.