aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-04-09 21:48:06 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-04-09 21:48:06 +0200
commit83fab0650880873f0fb77697acc4c5102ad5f166 (patch)
treee81c33a76ca3eb8899efea695078c38a7c45afde
parent4652541b61df5490d04cfa9efe57acd0612b3bc5 (diff)
introduced setting to turn of notification led
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java5
-rw-r--r--src/main/res/values/strings.xml8
-rw-r--r--src/main/res/xml/preferences.xml7
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 cec9a3ef..003f5471 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 e991d051..e9e99730 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -108,9 +108,11 @@
<string name="pref_notifications">Notifications</string>
<string name="pref_notifications_summary">Notify when a new message arrives</string>
<string name="pref_vibrate">Vibrate</string>
- <string name="pref_vibrate_summary">Also vibrate when a new message arrives</string>
- <string name="pref_sound">Sound</string>
- <string name="pref_sound_summary">Play ringtone with notification</string>
+ <string name="pref_vibrate_summary">Vibrate when a new message arrives</string>
+ <string name="pref_led">LED Notification</string>
+ <string name="pref_led_summary">Blink notification light when a new message arrives</string>
+ <string name="pref_sound">Ringtone</string>
+ <string name="pref_sound_summary">Play sound when a new message arrives</string>
<string name="pref_notification_grace_period">Notification grace period</string>
<string name="pref_notification_grace_period_summary">Disable notifications for a short time after a carbon copy was received</string>
<string name="pref_advanced_options">Advanced</string>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index f505baf7..e4b29856 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"/>
-
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:dependency="show_notification"
+ android:key="led"
+ android:title="@string/pref_led"
+ android:summary="@string/pref_led_summary"/>
<RingtonePreference
android:defaultValue="content://settings/system/notification_sound"
android:dependency="show_notification"