mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-09-12 07:45:59 +00:00
Fix new streams notification issue
This commit is contained in:
@@ -98,9 +98,15 @@
|
|||||||
|
|
||||||
<service android:name=".local.subscription.services.SubscriptionsImportService" />
|
<service android:name=".local.subscription.services.SubscriptionsImportService" />
|
||||||
<service android:name=".local.subscription.services.SubscriptionsExportService" />
|
<service android:name=".local.subscription.services.SubscriptionsExportService" />
|
||||||
<service android:name=".local.feed.service.FeedLoadService"
|
<service
|
||||||
|
android:name=".local.feed.service.FeedLoadService"
|
||||||
android:foregroundServiceType="dataSync" />
|
android:foregroundServiceType="dataSync" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name="androidx.work.impl.foreground.SystemForegroundService"
|
||||||
|
android:foregroundServiceType="dataSync"
|
||||||
|
tools:node="merge" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".PanicResponderActivity"
|
android:name=".PanicResponderActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
package org.schabi.newpipe.local.feed.notifications
|
package org.schabi.newpipe.local.feed.notifications
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.pm.ServiceInfo
|
||||||
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.work.Constraints
|
import androidx.work.Constraints
|
||||||
@@ -83,7 +85,8 @@ class NotificationWorker(
|
|||||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||||
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
|
.setContentTitle(applicationContext.getString(R.string.feed_notification_loading))
|
||||||
.build()
|
.build()
|
||||||
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification))
|
val serviceType = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC else 0
|
||||||
|
setForegroundAsync(ForegroundInfo(FeedLoadService.NOTIFICATION_ID, notification, serviceType))
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
Reference in New Issue
Block a user