mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-28 09:15:12 +03:00
flammenwerfert running notification again
This commit is contained in:
parent
ce37320e1e
commit
f83c4ea8df
1 changed files with 7 additions and 3 deletions
|
@ -4,6 +4,7 @@ import android.app.Notification
|
|||
import android.app.Service
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.os.PowerManager
|
||||
import androidx.annotation.StringRes
|
||||
|
@ -89,11 +90,14 @@ class AnimeDownloadService : Service() {
|
|||
|
||||
override fun onCreate() {
|
||||
scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
downloadManager.queue.state.value.forEach {
|
||||
startForeground(it.episode.id.hashCode(), getPlaceholderNotification())
|
||||
}
|
||||
wakeLock = acquireWakeLock(javaClass.name)
|
||||
_isRunning.value = true
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
startForeground(1, getPlaceholderNotification())
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
startForeground(1, Notification())
|
||||
}
|
||||
listenNetworkChanges()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue