aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-03-31 15:26:26 +0200
committersteckbrief <steckbrief@chefmail.de>2015-03-31 15:26:26 +0200
commit6220260df3a97a18baf32e3f4d70596cc1eec563 (patch)
treeb97ef531522aac490cc06715bd8fca7960b96d8a /src/main/java/eu/siacs
parent52ed924a1333448505e83204d3d9b248b2356004 (diff)
Configurable LED color (Attention: Expert setting because currently only text input)
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java11
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);