From eead91385ebc2bee86a93c8bfda334da0c5f6590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 28 Jul 2013 09:08:20 +0200 Subject: [PATCH] Do not invalidate all apps if not needed. This gets repo updates with no changes back to normal speed, keeping the new functionalities (icons download after cache clean) intact. --- src/org/fdroid/fdroid/UpdateService.java | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/org/fdroid/fdroid/UpdateService.java b/src/org/fdroid/fdroid/UpdateService.java index 68881d5a4..f2f8e14c6 100644 --- a/src/org/fdroid/fdroid/UpdateService.java +++ b/src/org/fdroid/fdroid/UpdateService.java @@ -256,19 +256,25 @@ public class UpdateService extends IntentService implements ProgressListener { if (success) { File d = DB.getIconsPath(this); - List toDownloadIcons = acceptedapps; - if (!d.exists()) { + List toDownloadIcons = null; + if (changes) { + toDownloadIcons = acceptedapps; + } else if (!d.exists()) { Log.d("FDroid", "Icons were wiped. Re-downloading all of them."); d.mkdirs(); toDownloadIcons = ((FDroidApp) getApplication()).getApps(); } - sendStatus(STATUS_INFO, - getString(R.string.status_downloading_icons)); - for (DB.App app : toDownloadIcons) - getIcon(app, repos); - ((FDroidApp) getApplication()).invalidateAllApps(); + if (toDownloadIcons != null) { + sendStatus(STATUS_INFO, + getString(R.string.status_downloading_icons)); + for (DB.App app : toDownloadIcons) + getIcon(app, repos); + } } + if (success && changes) + ((FDroidApp) getApplication()).invalidateAllApps(); + if (success && changes && notify && (newUpdates > prevUpdates)) { Log.d("FDroid", "Notifying updates. Apps before:" + prevUpdates + ", apps after: " + newUpdates);