[app] always check for new updates when index had changes

and auto-download updates only once, not again for each repo that gets updated
This commit is contained in:
Torsten Grote
2023-06-08 16:38:13 -03:00
parent a27326e7bb
commit 7aa3e419db

View File

@@ -489,17 +489,15 @@ public class UpdateService extends JobIntentService {
}
Log.e(TAG, "Error updating repository " + repo.getAddress(), e);
}
// now that downloading the index is done, start downloading updates
// TODO why are we checking for updates several times (in loop and below)
if (changes && fdroidPrefs.isAutoDownloadEnabled() && fdroidPrefs.isBackgroundDownloadAllowed()) {
autoDownloadUpdates(this);
}
}
if (!changes) {
Utils.debugLog(TAG, "Not checking app details or compatibility, because repos were up to date.");
} else if (fdroidPrefs.isUpdateNotificationEnabled() && !fdroidPrefs.isAutoDownloadEnabled()) {
if (changes) {
appUpdateStatusManager.checkForUpdates();
// now that downloading the index is done, start downloading updates
if (fdroidPrefs.isAutoDownloadEnabled() && fdroidPrefs.isBackgroundDownloadAllowed()) {
// this is using DbUpdateChecker#getUpdatableApps() again which isn't optimal
autoDownloadUpdates(this);
}
}
fdroidPrefs.setLastUpdateCheck(System.currentTimeMillis());