From b37c96df9cc9518d99ee240c4665c2f3c79a5964 Mon Sep 17 00:00:00 2001 From: Sam Mortimer Date: Sat, 10 Feb 2018 22:45:54 -0800 Subject: [PATCH] lineage-sdk lights: Treat requested led color of 0 as needing a default *) fw/b now sets the color to 0 to indicate that we need to set a default (to cover Oreo+ sdk where DEFAULT_LIGHTS has been deprecated). Change-Id: I91b7cfff2ea6f8c1b999b6246c14416a2a47cbfb --- .../internal/notification/LineageNotificationLights.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/src/java/org/lineageos/internal/notification/LineageNotificationLights.java b/sdk/src/java/org/lineageos/internal/notification/LineageNotificationLights.java index 491e518e..a6ddb9a8 100644 --- a/sdk/src/java/org/lineageos/internal/notification/LineageNotificationLights.java +++ b/sdk/src/java/org/lineageos/internal/notification/LineageNotificationLights.java @@ -238,7 +238,6 @@ public final class LineageNotificationLights { boolean screenActive, int suppressedEffects) { final boolean forcedOn = isForcedOn(n); final int forcedBrightness = getForcedBrightness(n); - final boolean isDefaultLights = (n.defaults & Notification.DEFAULT_LIGHTS) != 0; final boolean suppressScreenOff = (suppressedEffects & SUPPRESSED_EFFECT_SCREEN_OFF) != 0; final boolean suppressScreenOn = @@ -253,7 +252,6 @@ public final class LineageNotificationLights { + " suppressedEffects=" + suppressedEffects + " forcedOn=" + forcedOn + " forcedBrightness=" + forcedBrightness - + " isDefaultLights=" + isDefaultLights + " suppressScreenOff=" + suppressScreenOff + " suppressScreenOn=" + suppressScreenOn + " mCanAdjustBrightness=" + mCanAdjustBrightness @@ -313,7 +311,7 @@ public final class LineageNotificationLights { ledValuesPkg.getOnMs() : mDefaultNotificationLedOn); ledValues.setOffMs(ledValuesPkg.getOffMs() >= 0 ? ledValuesPkg.getOffMs() : mDefaultNotificationLedOff); - } else if (isDefaultLights) { + } else if (ledValues.getColor() == 0) { ledValues.setColor(generateLedColorForPackageName(packageName)); ledValues.setOnMs(mDefaultNotificationLedOn); ledValues.setOffMs(mDefaultNotificationLedOff);