diff options
author | ByteHamster <info@bytehamster.com> | 2019-06-03 12:19:34 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-06-03 12:19:34 +0200 |
commit | 6a83d2a4346b28a8ec004b6fbbb426dc051cd4a3 (patch) | |
tree | 089fbdda4a6874502ee706b6d9b95535db91a1ab /core | |
parent | 405db1f1691bb4f3aa6edff03701dc4a0842617b (diff) | |
download | AntennaPod-6a83d2a4346b28a8ec004b6fbbb426dc051cd4a3.zip |
Handle disabled auto update
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 8 |
1 files changed, 7 insertions, 1 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 118d434f8..60cec25d9 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 @@ -381,6 +381,10 @@ public class UserPreferences { } } + public static boolean isAutoUpdateDisabled() { + return prefs.getString(PREF_UPDATE_INTERVAL, "").equals("0"); + } + public static String getMobileUpdatesEnabled() { return prefs.getString(PREF_MOBILE_UPDATE, "images"); } @@ -832,7 +836,9 @@ public class UserPreferences { } public static void restartUpdateAlarm() { - if (isAutoUpdateTimeOfDay()) { + if (isAutoUpdateDisabled()) { + AutoUpdateManager.disableAutoUpdate(); + } else if (isAutoUpdateTimeOfDay()) { int[] timeOfDay = getUpdateTimeOfDay(); Log.d(TAG, "timeOfDay: " + Arrays.toString(timeOfDay)); AutoUpdateManager.restartUpdateTimeOfDayAlarm(timeOfDay[0], timeOfDay[1]); |