mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-15 15:02:49 +01:00
chore: set foreground service type for SyncDataJob
Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
parent
040c7a0fc1
commit
cc5e14088c
@ -1,6 +1,8 @@
|
|||||||
package eu.kanade.tachiyomi.data.sync
|
package eu.kanade.tachiyomi.data.sync
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.pm.ServiceInfo
|
||||||
|
import android.os.Build
|
||||||
import androidx.work.CoroutineWorker
|
import androidx.work.CoroutineWorker
|
||||||
import androidx.work.ExistingPeriodicWorkPolicy
|
import androidx.work.ExistingPeriodicWorkPolicy
|
||||||
import androidx.work.ExistingWorkPolicy
|
import androidx.work.ExistingWorkPolicy
|
||||||
@ -47,6 +49,11 @@ class SyncDataJob(private val context: Context, workerParams: WorkerParameters)
|
|||||||
return ForegroundInfo(
|
return ForegroundInfo(
|
||||||
Notifications.ID_RESTORE_PROGRESS,
|
Notifications.ID_RESTORE_PROGRESS,
|
||||||
notifier.showSyncProgress().build(),
|
notifier.showSyncProgress().build(),
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
|
||||||
|
} else {
|
||||||
|
0
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user