mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
catch color parsing errors
This commit is contained in:
@@ -71,7 +71,14 @@ public abstract class AbstractNotificationBuilder extends NotificationCompat.Bui
|
||||
|
||||
if (!ledColor.equals("none")) {
|
||||
String[] blinkPatternArray = parseBlinkPattern(ledBlinkPattern, ledBlinkPatternCustom);
|
||||
setLights(Color.parseColor(ledColor),
|
||||
int argb;
|
||||
try {
|
||||
argb = Color.parseColor(ledColor);
|
||||
}
|
||||
catch (Exception e) {
|
||||
argb = Color.rgb(0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
setLights(argb,
|
||||
Integer.parseInt(blinkPatternArray[0]),
|
||||
Integer.parseInt(blinkPatternArray[1]));
|
||||
}
|
||||
@@ -154,7 +161,14 @@ public abstract class AbstractNotificationBuilder extends NotificationCompat.Bui
|
||||
|
||||
if (!ledColor.equals("none")) {
|
||||
channel.enableLights(true);
|
||||
channel.setLightColor(Color.parseColor(ledColor));
|
||||
int argb;
|
||||
try {
|
||||
argb = Color.parseColor(ledColor);
|
||||
}
|
||||
catch (Exception e) {
|
||||
argb = Color.rgb(0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
channel.setLightColor(argb);
|
||||
} else {
|
||||
channel.enableLights(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user