liblights: Fix fast blinking notification LEDs.
authorJason Vidal <vidwhal@gmail.com>
Sun, 11 Jun 2017 08:02:38 +0000 (08:02 +0000)
committerSimon Shields <simon@lineageos.org>
Mon, 19 Jun 2017 13:54:09 +0000 (13:54 +0000)
Seems that the fast blinking notification LEDs experienced on some
Samsung devices was due to the removal of these two lines that clean
the 'blink' array. Propose re-inserting to correct the fast blinking
LED issue.

Change-Id: I88ea828a50468aae494b1dd54290607308de543a

liblights/lights.c

index 27be2480499c3ae0044f5f317ca587a8a6587b3c..875cf656f42d15b245bb96037b04a259254ca349 100644 (file)
@@ -199,6 +199,10 @@ static int write_leds(const struct led_config *led)
     ALOGV("%s: color=0x%08x, delay_on=%d, delay_off=%d, blink=%s",
           __func__, led->color, led->delay_on, led->delay_off, blink);
 
+    /* Add '\n' here to make the above log message clean. */
+    blink[count]   = '\n';
+    blink[count+1] = '\0';
+
     pthread_mutex_lock(&g_lock);
     err = write_str(LED_BLINK_NODE, blink);
     pthread_mutex_unlock(&g_lock);