From 415e8de02f2a6d8aee91ddae203a5ee24c72bf2e Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Sat, 14 Jul 2018 10:34:53 -0700 Subject: [PATCH] fw/b lights: Allow black notification color * Color 0 is used to mean "lineage-sdk should pick a default" * Explictly requesting black made the led blue (eg lineageparts light picker), fix that Change-Id: Ia03f898c1b6cd0f77af8bb155139b587664f47af --- .../com/android/server/notification/NotificationRecord.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index 77f278b3c8e66..f2d2eac17ffc9 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -218,6 +218,11 @@ public final class NotificationRecord { if ((notification.defaults & Notification.DEFAULT_LIGHTS) != 0) { light = new Light(defaultLightColor, defaultLightOn, defaultLightOff); + } else if (light.color == 0) { + // User has requested color 0. However, lineage-sdk interprets + // color 0 as "supply a default" therefore adjust alpha to make + // the color still black but non-zero. + light = new Light(0x01000000, light.onMs, light.offMs); } } else { light = null; -- GitLab