aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-01-15 16:17:55 +0100
committeriNPUTmice <daniel@gultsch.de>2015-01-15 16:17:55 +0100
commit994c9495bad07fd7307ea85986a7766adb15cf84 (patch)
treed570f49ce214b4d2776265c246ec781a9b1d8719 /src/main/java/eu
parent351e5d70652ccbb23bbd29ea75b1452f4fa8969e (diff)
added dedicated button to disable foreground service in perma notification
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 6f02fca9..a32bb279 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -409,13 +409,20 @@ public class NotificationService {
final NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mXmppConnectionService);
mBuilder.setSmallIcon(R.drawable.ic_stat_communication_import_export);
mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.conversations_foreground_service));
- mBuilder.setContentText(mXmppConnectionService.getString(R.string.touch_to_disable));
- mBuilder.setContentIntent(createDisableForeground());
+ mBuilder.setContentText(mXmppConnectionService.getString(R.string.touch_to_open_conversations));
+ mBuilder.addAction(R.drawable.ic_action_cancel,
+ mXmppConnectionService.getString(R.string.disable_foreground_service),
+ createDisableForeground());
+ mBuilder.setContentIntent(createOpenConversationsIntent());
mBuilder.setWhen(0);
mBuilder.setPriority(NotificationCompat.PRIORITY_MIN);
return mBuilder.build();
}
+ private PendingIntent createOpenConversationsIntent() {
+ return PendingIntent.getActivity(mXmppConnectionService, 0, new Intent(mXmppConnectionService,ConversationActivity.class),0);
+ }
+
public void updateErrorNotification() {
final NotificationManager mNotificationManager = (NotificationManager) mXmppConnectionService.getSystemService(Context.NOTIFICATION_SERVICE);
final List<Account> errors = new ArrayList<>();