From f54ebdb39b6247527ec4deab5e6f69f00cfe719b Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Sat, 8 Jul 2023 00:24:17 +0200 Subject: [PATCH] Trying random things to try to fix ForegroundServiceStartNotAllowedException --- src/org/kde/kdeconnect/BackgroundService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/org/kde/kdeconnect/BackgroundService.java b/src/org/kde/kdeconnect/BackgroundService.java index 10c73ab2..40077e22 100644 --- a/src/org/kde/kdeconnect/BackgroundService.java +++ b/src/org/kde/kdeconnect/BackgroundService.java @@ -206,6 +206,7 @@ public class BackgroundService extends Service { .setContentIntent(pi) .setPriority(NotificationCompat.PRIORITY_MIN) //MIN so it's not shown in the status bar before Oreo, on Oreo it will be bumped to LOW .setShowWhen(false) + .setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE) .setAutoCancel(false); notification.setGroup("BackgroundService");