diff options
author | Nathan Mascitelli <mascitelli.nathan@gmail.com> | 2020-03-24 20:03:04 -0400 |
---|---|---|
committer | Nathan Mascitelli <mascitelli.nathan@gmail.com> | 2020-03-24 20:03:04 -0400 |
commit | c2d87f57e584ebf4e85a1cf098da4ab6f224db58 (patch) | |
tree | 593c0e7e5d3e91fc6f5897855339206bfff4e0be /core/src/main/java/de/danoeh | |
parent | 16345468e33fb8252986c9ebfb26f3b0ad3a3c23 (diff) | |
download | AntennaPod-c2d87f57e584ebf4e85a1cf098da4ab6f224db58.zip |
Use different ids
Diffstat (limited to 'core/src/main/java/de/danoeh')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java index 1b072486c..8f74147f5 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadServiceNotification.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentLinkedDeque; public class DownloadServiceNotification { private static final String TAG = "DownloadSvcNotification"; private static final int REPORT_ID = 3; + private static final int AUTO_REPORT_ID = 4; private final Context context; private NotificationCompat.Builder notificationCompatBuilder; @@ -123,6 +124,7 @@ public class DownloadServiceNotification { String channelId; int titleId; int iconId; + int id; PendingIntent intent; if (failedDownloads == 0) { // We are generating an auto-download report @@ -130,11 +132,13 @@ public class DownloadServiceNotification { titleId = R.string.auto_download_report_title; iconId = R.drawable.stat_notify_sync; intent = ClientConfig.downloadServiceCallbacks.getAutoDownloadReportNotificationContentIntent(context); + id = AUTO_REPORT_ID; } else { channelId = NotificationUtils.CHANNEL_ID_ERROR; titleId = R.string.download_report_title; iconId = R.drawable.stat_notify_sync_error; intent = ClientConfig.downloadServiceCallbacks.getReportNotificationContentIntent(context); + id = REPORT_ID; } NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId); @@ -148,7 +152,7 @@ public class DownloadServiceNotification { builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC); } NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - nm.notify(REPORT_ID, builder.build()); + nm.notify(id, builder.build()); } else { Log.d(TAG, "No report is created"); } |