diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index efb667b22..8a6b22ab3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -96,8 +96,14 @@ android:exported="false" android:label="@string/title_activity_about" /> - - + + + + @@ -431,6 +437,7 @@ diff --git a/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java b/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java index 30420b0c7..e5e2544b2 100644 --- a/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java +++ b/app/src/main/java/org/schabi/newpipe/player/notification/NotificationUtil.java @@ -174,12 +174,8 @@ public final class NotificationUtil { } updateNotification(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - player.getService().startForeground(NOTIFICATION_ID, notificationBuilder.build(), - ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK); - } else { - player.getService().startForeground(NOTIFICATION_ID, notificationBuilder.build()); - } + ServiceCompat.startForeground(player.getService(), NOTIFICATION_ID, + notificationBuilder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK); } public void cancelNotificationAndStopForeground() {