diff options
author | qctecmdr <qctecmdr@localhost> | 2021-08-30 23:09:11 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-08-30 23:09:10 -0700 |
commit | 56fb1052841d19f3619289f6e0ae12c6424c2018 (patch) | |
tree | 2e58e74f982d3ea37d60210870ed1f1ff63c16f6 | |
parent | 64a5cb686ec48521e23b40342c364d64519ff397 (diff) | |
parent | fe51fae4708b4c2eb4bc8ccae03be99a468a7cfa (diff) |
Merge "display: light: clear timer trigger before setting brightness"
-rw-r--r-- | liblight/lights.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/liblight/lights.c b/liblight/lights.c index 41fb5a16..9dabafe9 100644 --- a/liblight/lights.c +++ b/liblight/lights.c @@ -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) |