diff options
author | ByteHamster <info@bytehamster.com> | 2019-11-24 20:05:07 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-11-24 20:05:07 +0100 |
commit | 5f5cf628ca28a50f4b3dfd66904c8b9c5344d85c (patch) | |
tree | 0d82f9193d467d795b5a882ea046d61a96688600 /core | |
parent | 4bda04447244bc5b371d71455822b89d174b2871 (diff) | |
download | AntennaPod-5f5cf628ca28a50f4b3dfd66904c8b9c5344d85c.zip |
Making sure that DownloadService always calls startForeground
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java | 8 |
1 files changed, 6 insertions, 2 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 1bf5f37d7..9bfc4f6ec 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 @@ -163,11 +163,15 @@ public class DownloadService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { - if (intent != null && - intent.getParcelableArrayListExtra(EXTRA_REQUESTS) != null) { + if (intent != null && intent.getParcelableArrayListExtra(EXTRA_REQUESTS) != null) { + Notification notification = notificationManager.updateNotifications( + requester.getNumberOfDownloads(), downloads); + startForeground(NOTIFICATION_ID, notification); onDownloadQueued(intent); } else if (numberOfDownloads.get() == 0) { stopSelf(); + } else { + Log.d(TAG, "onStartCommand: Unknown intent"); } return Service.START_NOT_STICKY; } |