Remove no longer available updates when refreshing the list

This commit is contained in:
Gabriele M
2017-07-07 22:05:23 +02:00
parent d327d61cc6
commit c90700d3d2
3 changed files with 24 additions and 0 deletions

View File

@@ -161,10 +161,14 @@ public class UpdatesActivity extends AppCompatActivity {
Log.d(TAG, "Adding remote updates");
UpdaterControllerInt controller = mUpdaterService.getUpdaterController();
boolean newUpdates = false;
List<String> updatesOnline = new ArrayList<>();
for (UpdateDownload update : Utils.parseJson(jsonFile, true)) {
newUpdates |= controller.addUpdate(update);
updatesOnline.add(update.getDownloadId());
}
controller.setUpdatesAvailableOnline(updatesOnline, true);
if (manualRefresh) {
showSnackBar(
newUpdates ? R.string.snack_updates_found : R.string.snack_no_updates_found,