aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-04-17 17:37:43 +0200
committerlookshe <github@lookshe.org>2016-04-17 17:37:43 +0200
commitad6208e53095e3a9870cdc0eae9b7c068a42829a (patch)
treed5216f567722d4d6a959ab262c6cbef22f1931e7 /src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java
parent1f81683d26eba69d7e4373bbda6295d5d7843777 (diff)
parentde7631e300eb9e578336d642dd279faecdb09391 (diff)
Merge branch 'trz/rebase' into trz/rename
Conflicts: build.gradle src/main/java/de/thedevstack/conversationsplus/services/AvatarService.java src/main/res/values-bg/strings.xml src/main/res/values-cs/strings.xml src/main/res/values-fr/strings.xml src/main/res/values-ja/strings.xml src/main/res/values-nl/strings.xml src/main/res/values-pt/strings.xml src/main/res/values-ro-rRO/strings.xml src/main/res/values-sv/strings.xml src/main/res/values-zh-rCN/strings.xml src/main/res/values/strings.xml
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java b/src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java
index 488a6075..b06dd95c 100644
--- a/src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java
+++ b/src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java
@@ -176,6 +176,7 @@ public class NotificationService {
final String ringtone = ConversationsPlusPreferences.notificationRingtone();
final boolean vibrate = ConversationsPlusPreferences.vibrateOnNotification();
+ final boolean led = ConversationsPlusPreferences.led();
if (notifications.size() == 0) {
notificationManager.cancel(NOTIFICATION_ID);
@@ -206,7 +207,9 @@ public class NotificationService {
mBuilder.setDefaults(0);
mBuilder.setSmallIcon(R.drawable.ic_notification);
mBuilder.setDeleteIntent(createDeleteIntent());
- mBuilder.setLights(Settings.LED_COLOR, 2000, 4000);
+ if (led) {
+ mBuilder.setLights(Settings.LED_COLOR, 2000, 4000);
+ }
final Notification notification = mBuilder.build();
notificationManager.notify(NOTIFICATION_ID, notification);
}
@@ -519,9 +522,11 @@ public class NotificationService {
cancelIcon = R.drawable.ic_action_cancel;
}
mBuilder.setSmallIcon(R.drawable.ic_link_white_24dp);
- mBuilder.addAction(cancelIcon,
- mXmppConnectionService.getString(R.string.disable_foreground_service),
- createDisableForeground());
+ if (Config.SHOW_DISABLE_FOREGROUND) {
+ mBuilder.addAction(cancelIcon,
+ mXmppConnectionService.getString(R.string.disable_foreground_service),
+ createDisableForeground());
+ }
return mBuilder.build();
}