summaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java7
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java4
2 files changed, 11 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
index 1f01bb32b..118d434f8 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
@@ -575,6 +575,13 @@ public class UserPreferences {
restartUpdateAlarm();
}
+ public static void disableAutoUpdate() {
+ prefs.edit()
+ .putString(PREF_UPDATE_INTERVAL, "0")
+ .apply();
+ AutoUpdateManager.disableAutoUpdate();
+ }
+
/**
* Change the auto-flattr settings
*
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
index 96b83a995..e5aaa2db0 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/download/AutoUpdateManager.java
@@ -60,6 +60,10 @@ public class AutoUpdateManager {
WorkManager.getInstance().enqueueUniqueWork(WORK_ID_FEED_UPDATE, ExistingWorkPolicy.REPLACE, workRequest);
}
+ public static void disableAutoUpdate() {
+ WorkManager.getInstance().cancelUniqueWork(WORK_ID_FEED_UPDATE);
+ }
+
private static Constraints getConstraints() {
Constraints.Builder constraints = new Constraints.Builder();