From 8b4502eef5f3bd06f19565ae04b58e018919f403 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 3 Apr 2020 12:50:54 +0200 Subject: [PATCH] Do not store Sync actions if user is not logged in --- .../java/de/danoeh/antennapod/core/sync/SyncService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java index be35badf0..828691737 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/sync/SyncService.java @@ -113,6 +113,9 @@ public class SyncService extends Worker { } public static void enqueueFeedAdded(Context context, String downloadUrl) { + if (!GpodnetPreferences.loggedIn()) { + return; + } synchronized (lock) { try { SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); @@ -128,6 +131,9 @@ public class SyncService extends Worker { } public static void enqueueFeedRemoved(Context context, String downloadUrl) { + if (!GpodnetPreferences.loggedIn()) { + return; + } synchronized (lock) { try { SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); @@ -143,6 +149,9 @@ public class SyncService extends Worker { } public static void enqueueEpisodeAction(Context context, EpisodeAction action) { + if (!GpodnetPreferences.loggedIn()) { + return; + } synchronized (lock) { try { SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);