1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-09-02 19:07:55 +00:00

Update manifest, startForeground call

This commit is contained in:
Isira Seneviratne
2025-07-27 11:58:01 +05:30
parent 59db955493
commit b9b47fc520
2 changed files with 11 additions and 8 deletions

View File

@@ -96,8 +96,14 @@
android:exported="false"
android:label="@string/title_activity_about" />
<service android:name=".local.subscription.services.SubscriptionsImportService" />
<service android:name=".local.subscription.services.SubscriptionsExportService" />
<service
android:name=".local.subscription.services.SubscriptionsImportService"
android:foregroundServiceType="dataSync" />
<service
android:name=".local.subscription.services.SubscriptionsExportService"
android:foregroundServiceType="dataSync" />
<service
android:name=".local.feed.service.FeedLoadService"
android:foregroundServiceType="dataSync" />
@@ -431,6 +437,7 @@
</activity>
<service
android:name=".RouterActivity$FetcherService"
android:foregroundServiceType="dataSync"
android:exported="false" />
<!-- opting out of sending metrics to Google in Android System WebView -->

View File

@@ -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() {