From 095461e31b969adacd74cc981be19ecb43b9b86b Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 3 Aug 2020 11:15:33 -0400 Subject: [PATCH] Explicitly dismiss progress notification on downloader stop --- .../java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt | 2 +- .../main/java/eu/kanade/tachiyomi/data/download/Downloader.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt index b7babaa75..f2136e7c1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt @@ -79,7 +79,7 @@ internal class DownloadNotifier(private val context: Context) { * Dismiss the downloader's notification. Downloader error notifications use a different id, so * those can only be dismissed by the user. */ - fun dismiss() { + fun dismissProgress() { context.notificationManager.cancel(Notifications.ID_DOWNLOAD_CHAPTER_PROGRESS) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt index 67e288f43..6b46e86eb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt @@ -139,6 +139,7 @@ class Downloader( notifier.paused = false notifier.onPaused() } else { + notifier.dismissProgress() notifier.onComplete() } } @@ -170,7 +171,7 @@ class Downloader( .forEach { it.status = Download.NOT_DOWNLOADED } } queue.clear() - notifier.dismiss() + notifier.dismissProgress() } /**