diff options
author | ByteHamster <info@bytehamster.com> | 2020-11-14 18:08:52 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-11-14 18:08:52 +0100 |
commit | f5bbdf1666a93dfbfdc02abcbc1be7ca54033ecb (patch) | |
tree | 76d89609c61f54ece46c171d5bf11db7a0d89076 | |
parent | 4decd1d9fee159a23acec58622a6696d8f512764 (diff) | |
download | AntennaPod-f5bbdf1666a93dfbfdc02abcbc1be7ca54033ecb.zip |
Stop foreground in DownloadService before calling stop
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java | 2 |
1 files changed, 2 insertions, 0 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 de106a01e..1df873e14 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 @@ -168,6 +168,7 @@ public class DownloadService extends Service { startForeground(R.id.notification_downloading, notification); syncExecutor.execute(() -> onDownloadQueued(intent)); } else if (numberOfDownloads.get() == 0) { + stopForeground(true); stopSelf(); } else { Log.d(TAG, "onStartCommand: Unknown intent"); @@ -553,6 +554,7 @@ public class DownloadService extends Service { if (numberOfDownloads.get() <= 0 && DownloadRequester.getInstance().hasNoDownloads()) { Log.d(TAG, "Number of downloads is " + numberOfDownloads.get() + ", attempting shutdown"); + stopForeground(true); stopSelf(); if (notificationUpdater != null) { notificationUpdater.run(); |