Make DownloadManager the sole entry point for DownloadService (#9140)
* Rename functions for DownloadService internal use * Call DownloadService.start via DownloadManager * Inline DownloadService.stop into pauseDownloads * Inline DownloadService.stop into clearQueue NotificationReceiver will now also stop the DownloadService when receiving ACTION_CLEAR_DOWNLOADS. * Provide DownloadService.isRunning via DownloadManager
This commit is contained in:
@@ -12,7 +12,6 @@ import eu.kanade.domain.download.service.DownloadPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.backup.BackupRestoreService
|
||||
import eu.kanade.tachiyomi.data.download.DownloadManager
|
||||
import eu.kanade.tachiyomi.data.download.DownloadService
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.data.updater.AppUpdateService
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
@@ -56,12 +55,9 @@ class NotificationReceiver : BroadcastReceiver() {
|
||||
// Dismiss notification
|
||||
ACTION_DISMISS_NOTIFICATION -> dismissNotification(context, intent.getIntExtra(EXTRA_NOTIFICATION_ID, -1))
|
||||
// Resume the download service
|
||||
ACTION_RESUME_DOWNLOADS -> DownloadService.start(context)
|
||||
ACTION_RESUME_DOWNLOADS -> downloadManager.startDownloads()
|
||||
// Pause the download service
|
||||
ACTION_PAUSE_DOWNLOADS -> {
|
||||
DownloadService.stop(context)
|
||||
downloadManager.pauseDownloads()
|
||||
}
|
||||
ACTION_PAUSE_DOWNLOADS -> downloadManager.pauseDownloads()
|
||||
// Clear the download queue
|
||||
ACTION_CLEAR_DOWNLOADS -> downloadManager.clearQueue()
|
||||
// Launch share activity and dismiss notification
|
||||
|
||||
Reference in New Issue
Block a user