create Config varibale to show the disable foreground service button

This commit is contained in:
Daniel Gultsch 2016-04-13 18:00:12 +02:00
parent 594e65bb2b
commit c53c6cb6b6
2 changed files with 6 additions and 3 deletions

View file

@ -48,6 +48,7 @@ public final class Config {
public static final boolean FORCE_ORBOT = false; // always use TOR public static final boolean FORCE_ORBOT = false; // always use TOR
public static final boolean HIDE_MESSAGE_TEXT_IN_NOTIFICATION = false; 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_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; public static final boolean ALWAYS_NOTIFY_BY_DEFAULT = false;

View file

@ -544,9 +544,11 @@ public class NotificationService {
cancelIcon = R.drawable.ic_action_cancel; cancelIcon = R.drawable.ic_action_cancel;
} }
mBuilder.setSmallIcon(R.drawable.ic_link_white_24dp); mBuilder.setSmallIcon(R.drawable.ic_link_white_24dp);
if (Config.SHOW_DISABLE_FOREGROUND) {
mBuilder.addAction(cancelIcon, mBuilder.addAction(cancelIcon,
mXmppConnectionService.getString(R.string.disable_foreground_service), mXmppConnectionService.getString(R.string.disable_foreground_service),
createDisableForeground()); createDisableForeground());
}
return mBuilder.build(); return mBuilder.build();
} }