From c0077192d792768ceedaf8831c0195e4ef77248e Mon Sep 17 00:00:00 2001
From: NWuensche <gh@nwuensche.com>
Date: Fri, 17 Jan 2025 19:45:40 +0000
Subject: [PATCH] Split notification channel of downloading and refreshing
 (#7610)

---
 .../net/download/service/feed/FeedUpdateWorker.java   |  2 +-
 ui/i18n/src/main/res/values/strings.xml               |  6 ++++--
 .../ui/notifications/NotificationUtils.java           | 11 +++++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateWorker.java b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateWorker.java
index a62ded3a3..cd6954ac8 100644
--- a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateWorker.java
+++ b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateWorker.java
@@ -123,7 +123,7 @@ public class FeedUpdateWorker extends Worker {
                 }
             }
         }
-        return new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_DOWNLOADING)
+        return new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_REFRESHING)
                 .setContentTitle(context.getString(R.string.download_notification_title_feeds))
                 .setContentText(contentText)
                 .setStyle(new NotificationCompat.BigTextStyle().bigText(bigText))
diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml
index ab23c0e47..b04ba04da 100644
--- a/ui/i18n/src/main/res/values/strings.xml
+++ b/ui/i18n/src/main/res/values/strings.xml
@@ -860,8 +860,10 @@
     <string name="notification_group_news">News</string>
     <string name="notification_channel_user_action">Action required</string>
     <string name="notification_channel_user_action_description">Shown if your action is required, for example if you need to enter a password.</string>
-    <string name="notification_channel_downloading">Downloading</string>
-    <string name="notification_channel_downloading_description">Shown while currently downloading.</string>
+    <string name="notification_channel_downloading">Downloading episodes</string>
+    <string name="notification_channel_downloading_description">Shown while currently downloading episodes.</string>
+    <string name="notification_channel_refreshing">Refreshing podcasts</string>
+    <string name="notification_channel_refreshing_description">Shown while checking for new episodes.</string>
     <string name="notification_channel_playing">Currently playing</string>
     <string name="notification_channel_playing_description">Allows to control playback. This is the main notification you see while playing a podcast.</string>
     <string name="notification_channel_download_error">Download failed</string>
diff --git a/ui/notifications/src/main/java/de/danoeh/antennapod/ui/notifications/NotificationUtils.java b/ui/notifications/src/main/java/de/danoeh/antennapod/ui/notifications/NotificationUtils.java
index 93cf6baf1..f16296d7b 100644
--- a/ui/notifications/src/main/java/de/danoeh/antennapod/ui/notifications/NotificationUtils.java
+++ b/ui/notifications/src/main/java/de/danoeh/antennapod/ui/notifications/NotificationUtils.java
@@ -14,6 +14,7 @@ import de.danoeh.antennapod.storage.preferences.UserPreferences;
 public class NotificationUtils {
     public static final String CHANNEL_ID_USER_ACTION = "user_action";
     public static final String CHANNEL_ID_DOWNLOADING = "downloading";
+    public static final String CHANNEL_ID_REFRESHING = "refreshing";
     public static final String CHANNEL_ID_PLAYING = "playing";
     public static final String CHANNEL_ID_DOWNLOAD_ERROR = "error";
     public static final String CHANNEL_ID_SYNC_ERROR = "sync_error";
@@ -33,6 +34,7 @@ public class NotificationUtils {
         final List<NotificationChannelCompat> channels = Arrays.asList(
                 createChannelUserAction(context),
                 createChannelDownloading(context),
+                createChannelRefreshing(context),
                 createChannelPlaying(context),
                 createChannelError(context),
                 createChannelSyncError(context),
@@ -58,6 +60,15 @@ public class NotificationUtils {
                 .build();
     }
 
+    private static NotificationChannelCompat createChannelRefreshing(final Context c) {
+        return new NotificationChannelCompat.Builder(
+                        CHANNEL_ID_REFRESHING, NotificationManagerCompat.IMPORTANCE_LOW)
+                .setName(c.getString(R.string.notification_channel_refreshing))
+                .setDescription(c.getString(R.string.notification_channel_refreshing_description))
+                .setShowBadge(false)
+                .build();
+    }
+
     private static NotificationChannelCompat createChannelPlaying(final Context c) {
         return new NotificationChannelCompat.Builder(
                         CHANNEL_ID_PLAYING, NotificationManagerCompat.IMPORTANCE_LOW)