From f6c61f4e4b086489398bf2067d6a401cb9192083 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Sat, 25 Feb 2023 11:31:18 +0100 Subject: [PATCH] Specify the foreground service type in Android 29+ --- AndroidManifest.xml | 3 +-- src/org/kde/kdeconnect/BackgroundService.java | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 13d6420e..d8a02fb8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -46,8 +46,7 @@ - - + = Build.VERSION_CODES.Q) { + startForeground(FOREGROUND_NOTIFICATION_ID, createForegroundNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE); + } else { + startForeground(FOREGROUND_NOTIFICATION_ID, createForegroundNotification()); + } } return Service.START_STICKY; }