Handle disabled auto update

This commit is contained in:
ByteHamster 2019-06-03 12:19:34 +02:00
parent 405db1f169
commit 6a83d2a434

View File

@ -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]);