summaryrefslogtreecommitdiff
path: root/net/download
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-03-29 21:05:02 +0100
committerGitHub <noreply@github.com>2024-03-29 21:05:02 +0100
commit8accb546850e5d66aaab310c4cd4a528c058386e (patch)
treecc6ea8bd7304db5d2dae0467bae04d491137cef2 /net/download
parent2fd73b148d012fba7308c86494689103b8aaace4 (diff)
downloadAntennaPod-8accb546850e5d66aaab310c4cd4a528c058386e.zip
Move playback service to module (#7042)
Diffstat (limited to 'net/download')
-rw-r--r--net/download/service/src/main/AndroidManifest.xml14
-rw-r--r--net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateReceiver.java23
-rw-r--r--net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/NewEpisodesNotification.java2
3 files changed, 37 insertions, 2 deletions
diff --git a/net/download/service/src/main/AndroidManifest.xml b/net/download/service/src/main/AndroidManifest.xml
index 1319b5274..240319a5e 100644
--- a/net/download/service/src/main/AndroidManifest.xml
+++ b/net/download/service/src/main/AndroidManifest.xml
@@ -1,7 +1,19 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@mipmap/ic_launcher"
+ android:supportsRtl="true">
+
+ <receiver android:name=".feed.FeedUpdateReceiver"
+ android:label="@string/feed_update_receiver_name"
+ android:exported="true"
+ tools:ignore="ExportedReceiver" /> <!-- allow feeds update to be triggered by external apps -->
+ </application>
+
</manifest>
diff --git a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateReceiver.java b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateReceiver.java
new file mode 100644
index 000000000..a230497d0
--- /dev/null
+++ b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/FeedUpdateReceiver.java
@@ -0,0 +1,23 @@
+package de.danoeh.antennapod.net.download.service.feed;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+
+import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
+
+/**
+ * Refreshes all feeds when it receives an intent
+ */
+public class FeedUpdateReceiver extends BroadcastReceiver {
+
+ private static final String TAG = "FeedUpdateReceiver";
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.d(TAG, "Received intent");
+ FeedUpdateManager.getInstance().runOnce(context);
+ }
+
+}
diff --git a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/NewEpisodesNotification.java b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/NewEpisodesNotification.java
index e326601ce..b95111b93 100644
--- a/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/NewEpisodesNotification.java
+++ b/net/download/service/src/main/java/de/danoeh/antennapod/net/download/service/feed/NewEpisodesNotification.java
@@ -18,10 +18,10 @@ import androidx.core.content.ContextCompat;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
-import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedCounter;
import de.danoeh.antennapod.model.feed.FeedPreferences;
+import de.danoeh.antennapod.net.download.service.R;
import de.danoeh.antennapod.storage.database.PodDBAdapter;
import de.danoeh.antennapod.ui.notifications.NotificationUtils;