Set foreground service behavior

pull/214/head
M66B 8 months ago
parent fb12509d8c
commit f688212fdd

@ -144,6 +144,7 @@ public class ServiceExternal extends Service {
private Notification getNotification() {
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "service")
.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_DEFERRED)
.setSmallIcon(R.drawable.baseline_compare_arrows_white_24)
.setContentTitle(getString(R.string.tile_synchronize))
.setAutoCancel(false)

@ -231,6 +231,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
private Notification getNotificationService(boolean alert) {
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "send")
.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_IMMEDIATE)
.setSmallIcon(R.drawable.baseline_send_white_24)
.setContentTitle(getString(R.string.title_notification_sending))
.setContentIntent(getPendingIntent(this))

@ -1461,6 +1461,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
// Build notification
NotificationCompat.Builder builder =
new NotificationCompat.Builder(this, "service")
.setForegroundServiceBehavior(Notification.FOREGROUND_SERVICE_DEFAULT)
.setSmallIcon(R.drawable.baseline_compare_arrows_white_24)
.setContentIntent(piWhy)
.setAutoCancel(false)

Loading…
Cancel
Save