diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-04-13 18:00:12 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-04-13 18:00:12 +0200 |
commit | c53c6cb6b60a575fb40746d840b80f8781a9bfab (patch) | |
tree | cc5d3f51de4fd4652f0b21aadad4e468f6855d55 /src/main/java/eu/siacs | |
parent | 594e65bb2b26d1c99b96c12558bf9d523e68269e (diff) |
create Config varibale to show the disable foreground service button
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/Config.java | 1 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/NotificationService.java | 8 |
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(); } |