From 3461bc376b8dbe6464e9db9c6a0c7f2e549378f5 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 15 Dec 2019 10:03:14 +0100 Subject: [PATCH] Cancel notification after cancelling notification updater Otherwise, the notification can stay while the service is actually stopped --- .../antennapod/core/service/download/DownloadService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 04c1190a7..73133620d 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 @@ -213,10 +213,6 @@ public class DownloadService extends Service { EventBus.getDefault().postSticky(DownloadEvent.refresh(Collections.emptyList())); - stopForeground(true); - NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); - nm.cancel(NOTIFICATION_ID); - downloadCompletionThread.interrupt(); try { downloadCompletionThread.join(); @@ -231,6 +227,10 @@ public class DownloadService extends Service { } unregisterReceiver(cancelDownloadReceiver); + stopForeground(true); + NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + nm.cancel(NOTIFICATION_ID); + // if this was the initial gpodder sync, i.e. we just synced the feeds successfully, // it is now time to sync the episode actions if (GpodnetPreferences.loggedIn() &&