From 83fab0650880873f0fb77697acc4c5102ad5f166 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 9 Apr 2016 21:48:06 +0200 Subject: [PATCH] introduced setting to turn of notification led --- .../siacs/conversations/services/NotificationService.java | 5 ++++- src/main/res/values/strings.xml | 8 +++++--- src/main/res/xml/preferences.xml | 7 ++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index cec9a3ef8..003f54715 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -180,6 +180,7 @@ public class NotificationService { final String ringtone = preferences.getString("notification_ringtone", null); final boolean vibrate = preferences.getBoolean("vibrate_on_notification", true); + final boolean led = preferences.getBoolean("led", true); if (notifications.size() == 0) { notificationManager.cancel(NOTIFICATION_ID); @@ -210,7 +211,9 @@ public class NotificationService { mBuilder.setDefaults(0); mBuilder.setSmallIcon(R.drawable.ic_notification); mBuilder.setDeleteIntent(createDeleteIntent()); - mBuilder.setLights(0xff00FF00, 2000, 3000); + if (led) { + mBuilder.setLights(0xff00FF00, 2000, 3000); + } final Notification notification = mBuilder.build(); notificationManager.notify(NOTIFICATION_ID, notification); } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index e991d0518..e9e997305 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -108,9 +108,11 @@ Notifications Notify when a new message arrives Vibrate - Also vibrate when a new message arrives - Sound - Play ringtone with notification + Vibrate when a new message arrives + LED Notification + Blink notification light when a new message arrives + Ringtone + Play sound when a new message arrives Notification grace period Disable notifications for a short time after a carbon copy was received Advanced diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index f505baf7c..e4b29856b 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -79,7 +79,12 @@ android:key="vibrate_on_notification" android:summary="@string/pref_vibrate_summary" android:title="@string/pref_vibrate"/> - +