File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
java/org/schabi/newpipe/local/feed/notifications Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 9898
9999 <service android : name =" .local.subscription.services.SubscriptionsImportService" />
100100 <service android : name =" .local.subscription.services.SubscriptionsExportService" />
101- <service android : name =" .local.feed.service.FeedLoadService"
101+ <service
102+ android : name =" .local.feed.service.FeedLoadService"
102103 android : foregroundServiceType =" dataSync" />
103104
105+ <service
106+ android : name =" androidx.work.impl.foreground.SystemForegroundService"
107+ android : foregroundServiceType =" dataSync"
108+ tools : node =" merge" />
109+
104110 <activity
105111 android : name =" .PanicResponderActivity"
106112 android : exported =" true"
Original file line number Diff line number Diff line change 11package org.schabi.newpipe.local.feed.notifications
22
33import android.content.Context
4+ import android.content.pm.ServiceInfo
5+ import android.os.Build
46import android.util.Log
57import androidx.core.app.NotificationCompat
68import androidx.work.Constraints
@@ -83,7 +85,8 @@ class NotificationWorker(
8385 .setPriority(NotificationCompat .PRIORITY_LOW )
8486 .setContentTitle(applicationContext.getString(R .string.feed_notification_loading))
8587 .build()
86- setForegroundAsync(ForegroundInfo (FeedLoadService .NOTIFICATION_ID , notification))
88+ val serviceType = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) ServiceInfo .FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
89+ setForegroundAsync(ForegroundInfo (FeedLoadService .NOTIFICATION_ID , notification, serviceType))
8790 }
8891
8992 companion object {
You can’t perform that action at this time.
0 commit comments