Skip to content

Commit

Permalink
Merge "display: light: clear timer trigger before setting brightness"
Browse files Browse the repository at this point in the history
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Aug 31, 2021
2 parents 64a5cb6 + fe51fae commit 56fb105
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions liblight/lights.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ static int set_rgb_led_brightness(enum rgb_led led, int brightness)
char file[48];
int rc;

snprintf(file, sizeof(file), "/sys/class/leds/%s/trigger", led_names[led]);
rc = write_str(file, "none");
if (rc < 0) {
ALOGD("%s failed to set trigger to none\n", led_names[led]);
return rc;
}

snprintf(file, sizeof(file), "/sys/class/leds/%s/brightness", led_names[led]);
rc = write_int(file, brightness);
if (rc < 0)
Expand Down

0 comments on commit 56fb105

Please sign in to comment.