diff options
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 7269a559..fa079829 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -215,12 +215,21 @@ public class NotificationService { mBuilder.setDefaults(0); mBuilder.setSmallIcon(R.drawable.ic_notification); mBuilder.setDeleteIntent(createDeleteIntent()); - mBuilder.setLights(0xff00FF00, 2000, 3000); + mBuilder.setLights(this.getLedNotificationColor(preferences), 2000, 4000); final Notification notification = mBuilder.build(); notificationManager.notify(NOTIFICATION_ID, notification); } } + private int getLedNotificationColor(SharedPreferences preferences) { + String ledColorString = preferences.getString("led_notification_color", "0xffffffff"); + try { + return Integer.valueOf(ledColorString); + } catch (NumberFormatException e) { + return 0xffffffff; + } + } + private Builder buildMultipleConversation() { final Builder mBuilder = new NotificationCompat.Builder( mXmppConnectionService); |