Merge branch 'update-scheduler-tweaks' into 'master'

Don't require device to be idle for RepoUpdateWorker to run

Closes #1794

See merge request fdroid/fdroidclient!1411
This commit is contained in:
Hans-Christoph Steiner
2024-09-03 12:51:07 +00:00
3 changed files with 5 additions and 2 deletions

View File

@@ -266,7 +266,10 @@ public class PreferencesFragment extends PreferenceFragmentCompat
private String getUpdateIntervalSeekbarSummary(int position) {
StringBuilder sb = new StringBuilder();
sb.append(getString(UPDATE_INTERVAL_NAMES[position]));
if (nextUpdateCheck < Long.MAX_VALUE) {
if (nextUpdateCheck < 0) {
sb.append("\n");
sb.append(getString(R.string.auto_update_time_past));
} else if (nextUpdateCheck < Long.MAX_VALUE) {
sb.append("\n");
CharSequence nextUpdate = DateUtils.getRelativeTimeSpanString(nextUpdateCheck,
System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE);

View File

@@ -87,7 +87,6 @@ class RepoUpdateWorker(
NetworkType.UNMETERED
}
val constraints = Constraints.Builder()
.setRequiresDeviceIdle(true)
.setRequiresBatteryNotLow(true)
.setRequiresStorageNotLow(true)
.setRequiredNetworkType(networkType)

View File

@@ -679,6 +679,7 @@ This often occurs with apps installed via Google Play or other sources, if they
<string name="interval_2w">Check for updates every 2 weeks</string>
<!-- "updates" as in software updates -->
<string name="auto_update_time">Earliest next update: %s</string>
<string name="auto_update_time_past">Next update when conditions are fulfilled</string>
<string name="keep_hour">1 Hour</string>
<string name="keep_day">1 Day</string>