aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-04-13 18:00:12 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-04-13 18:00:12 +0200
commitc53c6cb6b60a575fb40746d840b80f8781a9bfab (patch)
treecc5d3f51de4fd4652f0b21aadad4e468f6855d55
parent594e65bb2b26d1c99b96c12558bf9d523e68269e (diff)
create Config varibale to show the disable foreground service button
-rw-r--r--src/main/java/eu/siacs/conversations/Config.java1
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java8
2 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java
index e39cd654..55fff255 100644
--- a/src/main/java/eu/siacs/conversations/Config.java
+++ b/src/main/java/eu/siacs/conversations/Config.java
@@ -48,6 +48,7 @@ public final class Config {
public static final boolean FORCE_ORBOT = false; // always use TOR
public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false;
public static final boolean SHOW_CONNECTED_ACCOUNTS = false; //show number of connected accounts in foreground notification
+ public static final boolean SHOW_DISABLE_FOREGROUND = true; //if set to true the foreground notification has a button to disable it
public static final boolean ALWAYS_NOTIFY_BY_DEFAULT = false;
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 003f5471..764a1d52 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -544,9 +544,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();
}