Merge branch 'forced-update' into 'master'

Purge database only once after a forced update

Closes #1586

See merge request fdroid/fdroidclient!748
This commit is contained in:
Hans-Christoph Steiner 2018-09-11 08:42:51 +00:00
commit 2a9a3bddae

View File

@ -428,6 +428,9 @@ public class UpdateService extends JobIntentService {
return;
} else if ((manualUpdate || forcedUpdate) && fdroidPrefs.isOnDemandDownloadAllowed()) {
Utils.debugLog(TAG, "manually requested or forced update");
if (forcedUpdate) {
DBHelper.resetTransient(this);
}
} else if (!fdroidPrefs.isBackgroundDownloadAllowed() && !fdroidPrefs.isOnDemandDownloadAllowed()) {
Utils.debugLog(TAG, "don't run update");
return;
@ -461,10 +464,6 @@ public class UpdateService extends JobIntentService {
sendStatus(this, STATUS_INFO, getString(R.string.status_connecting_to_repo, repo.address));
if (forcedUpdate) {
DBHelper.resetTransient(this);
}
try {
RepoUpdater updater = new IndexV1Updater(this, repo);
if (Preferences.get().isForceOldIndexEnabled() || !updater.update()) {