diff --git a/app/build.gradle b/app/build.gradle
index 902c87291..bc1fe2278 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -15,7 +15,7 @@ android {
defaultConfig {
applicationId "org.xbmc.kore"
minSdkVersion 24
- targetSdkVersion 33
+ targetSdkVersion 34
versionCode 31
versionName = getVersionName()
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0e73631ea..3eaaefdbb 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -9,6 +9,7 @@
+
diff --git a/app/src/main/java/org/xbmc/kore/service/MediaSessionService.java b/app/src/main/java/org/xbmc/kore/service/MediaSessionService.java
index 0d24746cf..4474da276 100644
--- a/app/src/main/java/org/xbmc/kore/service/MediaSessionService.java
+++ b/app/src/main/java/org/xbmc/kore/service/MediaSessionService.java
@@ -10,6 +10,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
+import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
@@ -200,7 +201,11 @@ public int onStartCommand(Intent intent, int flags, int startId) {
}
// Request foreground and show default notification, will update later
- startForeground(NOTIFICATION_ID, nothingPlayingNotification);
+ if (Utils.isUpsideDownCakeOrLater()) {
+ startForeground(NOTIFICATION_ID, nothingPlayingNotification, ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
+ } else {
+ startForeground(NOTIFICATION_ID, nothingPlayingNotification);
+ }
HostConnectionObserver connectionObserver = HostManager.getInstance(this).getHostConnectionObserver();
if (hostConnectionObserver == null || hostConnectionObserver != connectionObserver) {
diff --git a/app/src/main/java/org/xbmc/kore/utils/Utils.java b/app/src/main/java/org/xbmc/kore/utils/Utils.java
index b4719c2b4..cbee0f6eb 100644
--- a/app/src/main/java/org/xbmc/kore/utils/Utils.java
+++ b/app/src/main/java/org/xbmc/kore/utils/Utils.java
@@ -52,6 +52,10 @@ public static boolean isTiramisuOrLater() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU;
}
+ public static boolean isUpsideDownCakeOrLater() {
+ return Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
+ }
+
/**
* Concats a list of strings
* @param list List to concatenate