summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2020-02-19 16:33:54 +0100
committerByteHamster <info@bytehamster.com>2020-02-19 16:33:57 +0100
commit431f0bd074f45077d64c35ce44df80e932000bd2 (patch)
tree16ffe1a1f3b3b7d5e13d3b912a54870d19877bc5
parent4e26749757088a9f32fd1b6f89c28a186a9d32dd (diff)
downloadAntennaPod-431f0bd074f45077d64c35ce44df80e932000bd2.zip
Hide downloading notification earlier
I do not know why showing the notification makes it disappear earlier but even if it does not disappear earlier, the number will now be updated to show "0 downloads left" instead of incorrectly sticking with 1 download until dismissed.
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
index 10e271bb0..b8215232c 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
@@ -558,6 +558,7 @@ public class DownloadService extends Service {
if (numberOfDownloads.get() <= 0 && DownloadRequester.getInstance().hasNoDownloads()) {
Log.d(TAG, "Number of downloads is " + numberOfDownloads.get() + ", attempting shutdown");
stopSelf();
+ notificationUpdater.run();
} else {
setupNotificationUpdater();
Notification notification = notificationManager.updateNotifications(
@@ -616,8 +617,8 @@ public class DownloadService extends Service {
* Schedules the notification updater task if it hasn't been scheduled yet.
*/
private void setupNotificationUpdater() {
- Log.d(TAG, "Setting up notification updater");
if (notificationUpdater == null) {
+ Log.d(TAG, "Setting up notification updater");
notificationUpdater = new NotificationUpdater();
notificationUpdaterFuture = schedExecutor.scheduleAtFixedRate(notificationUpdater, 1, 1, TimeUnit.SECONDS);
}