aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java7
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index fdf48258f..e37dc14f4 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -934,6 +934,7 @@ public class NotificationService {
mBuilder.setProgress(100, current, false);
mBuilder.setSmallIcon(R.drawable.ic_hourglass_empty_white_24dp);
mBuilder.setContentIntent(createContentIntent(message.getConversation()));
+ mBuilder.setOngoing(true);
if (Compatibility.twentySix()) {
mBuilder.setChannelId(VIDEOCOMPRESSION_CHANNEL_ID);
}
@@ -941,12 +942,17 @@ public class NotificationService {
notify(FOREGROUND_NOTIFICATION_ID, notification);
}
+ public void dismissForcedForegroundNotification() {
+ cancel(FOREGROUND_NOTIFICATION_ID);
+ }
+
public Notification exportLogsNotification() {
Notification.Builder mBuilder = new Notification.Builder(mXmppConnectionService);
mBuilder.setContentTitle(mXmppConnectionService.getString(R.string.app_name));
mBuilder.setContentText(mXmppConnectionService.getString(R.string.notification_export_logs_title));
mBuilder.setProgress(0, 0, true);
mBuilder.setSmallIcon(R.drawable.ic_import_export_white_24dp);
+ mBuilder.setOngoing(true);
if (Compatibility.twentySix()) {
mBuilder.setChannelId(BACKUP_CHANNEL_ID);
}
@@ -964,6 +970,7 @@ public class NotificationService {
mBuilder.setContentText(String.format(mXmppConnectionService.getString(R.string.update_available), version, filesize));
mBuilder.setSmallIcon(R.drawable.ic_update_notification);
mBuilder.setContentIntent(intent);
+ mBuilder.setOngoing(true);
if (Compatibility.twentySix()) {
mBuilder.setChannelId(UPDATE_CHANNEL_ID);
}
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index d9181aa95..01295c242 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -428,6 +428,7 @@ public class XmppConnectionService extends Service {
public void stopForcingForegroundNotification() {
mForceForegroundService.set(false);
toggleForegroundService();
+ mNotificationService.dismissForcedForegroundNotification();
}
public boolean areMessagesInitialized() {