From 08a7dfade9239406ca55bcc55f56f03a80c42f9e Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Fri, 7 Jul 2017 22:05:22 +0200 Subject: [PATCH] Track "online updates" rather than "local updates" This is a preparation commit with no actual changes. --- .../updater/controller/UpdaterController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/org/lineageos/updater/controller/UpdaterController.java b/src/org/lineageos/updater/controller/UpdaterController.java index 419020e7..14cf4452 100644 --- a/src/org/lineageos/updater/controller/UpdaterController.java +++ b/src/org/lineageos/updater/controller/UpdaterController.java @@ -79,7 +79,7 @@ public class UpdaterController implements UpdaterControllerInt { mWakeLock.setReferenceCounted(false); for (UpdateDownload update : mUpdatesDbHelper.getUpdates()) { - addUpdate(update, true); + addUpdate(update, false); } } @@ -285,19 +285,19 @@ public class UpdaterController implements UpdaterControllerInt { @Override public boolean addUpdate(UpdateDownload update) { - return addUpdate(update, false); + return addUpdate(update, true); } - private boolean addUpdate(final UpdateDownload update, boolean local) { + private boolean addUpdate(final UpdateDownload update, boolean availableOnline) { Log.d(TAG, "Adding download: " + update.getDownloadId()); if (mDownloads.containsKey(update.getDownloadId())) { Log.e(TAG, "Download (" + update.getDownloadId() + ") already added"); return false; } - if (!fixUpdateStatus(update) && local) { + if (!fixUpdateStatus(update) && !availableOnline) { update.setPersistentStatus(UpdateStatus.Persistent.UNKNOWN); deleteUpdateAsync(update); - Log.d(TAG, update.getDownloadId() + " had an invalid status and is local"); + Log.d(TAG, update.getDownloadId() + " had an invalid status and is not online"); return false; } mDownloads.put(update.getDownloadId(), new DownloadEntry(update));