Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a7dbc34 authored by Adrian DC's avatar Adrian DC Committed by Arne Coucheron
Browse files

fw/b: Resolve black forced lights with notifications channels

 * The initial fix for blue lights upon 0x00000000 color selection
   in the settings by change Ia03f898c1b6cd0f77af8bb155139b587664f47af
   (fw/b lights: Allow black notification color) no longer works
   because the notification now uses channels, hence bypassing
   the "mPreChannelsNotification" checks used in this condition

 * Instead, validate the lights is forced on and black
   before calling the Lineage lights colors calculation

Change-Id: Iafac2c51878d84afd980b378b1c53f6c31073d2c
parent e0fe7dd5
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -8193,6 +8193,15 @@ public class NotificationManagerService extends SystemService {
        }

        LedValues ledValues = new LedValues(light.color, light.onMs, light.offMs);
        int ledColor = light.color;
        if (isLedForcedOn(ledNotification) && ledColor == 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.
            ledColor = 0x01000000;
        }

        LedValues ledValues = new LedValues(ledColor, light.onMs, light.offMs);
        mLineageNotificationLights.calcLights(ledValues, ledNotification.getSbn().getPackageName(),
                ledNotification.getSbn().getNotification(), mScreenOn || isInCall(),
                ledNotification.getSuppressedVisualEffects());
+0 −5
Original line number Diff line number Diff line
@@ -278,11 +278,6 @@ 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;