Add mobile sync setting (#6349)
This commit is contained in:
parent
658c47f7a7
commit
6d72d7cebf
|
@ -140,6 +140,7 @@ public class PreferenceUpgrader {
|
|||
.putBoolean(UserPreferences.PREF_THEME_BLACK, true)
|
||||
.apply();
|
||||
}
|
||||
UserPreferences.setAllowMobileSync(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ public class SyncService extends Worker {
|
|||
|
||||
private static OneTimeWorkRequest.Builder getWorkRequest() {
|
||||
Constraints.Builder constraints = new Constraints.Builder();
|
||||
if (UserPreferences.isAllowMobileFeedRefresh()) {
|
||||
if (UserPreferences.isAllowMobileSync()) {
|
||||
constraints.setRequiredNetworkType(NetworkType.CONNECTED);
|
||||
} else {
|
||||
constraints.setRequiredNetworkType(NetworkType.UNMETERED);
|
||||
|
|
|
@ -93,6 +93,7 @@
|
|||
<item>@string/pref_mobileUpdate_auto_download</item>
|
||||
<item>@string/pref_mobileUpdate_streaming</item>
|
||||
<item>@string/pref_mobileUpdate_images</item>
|
||||
<item>@string/synchronization_pref</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="mobile_update_values">
|
||||
|
@ -101,10 +102,12 @@
|
|||
<item>auto_download</item>
|
||||
<item>streaming</item>
|
||||
<item>images</item>
|
||||
<item>sync</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="mobile_update_default_value">
|
||||
<item>images</item>
|
||||
<item>sync</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="episode_cleanup_entries">
|
||||
|
|
|
@ -507,6 +507,10 @@ public class UserPreferences {
|
|||
return isAllowMobileFor("feed_refresh");
|
||||
}
|
||||
|
||||
public static boolean isAllowMobileSync() {
|
||||
return isAllowMobileFor("sync");
|
||||
}
|
||||
|
||||
public static boolean isAllowMobileEpisodeDownload() {
|
||||
return isAllowMobileFor("episode_download");
|
||||
}
|
||||
|
@ -556,6 +560,10 @@ public class UserPreferences {
|
|||
setAllowMobileFor("images", allow);
|
||||
}
|
||||
|
||||
public static void setAllowMobileSync(boolean allow) {
|
||||
setAllowMobileFor("sync", allow);
|
||||
}
|
||||
|
||||
public static int getParallelDownloads() {
|
||||
return Integer.parseInt(prefs.getString(PREF_PARALLEL_DOWNLOADS, "4"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue