From ab9ac395f0696d36f0ea85376ca29bfe4edecabe Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Fri, 7 Jul 2017 22:05:22 +0200 Subject: [PATCH] Use deleteUpdateAsync() even if we know the file doesn't exist deleteUpdateAsync() is safe and it makes the code more readable at the expense of an extra File.exists() call. --- .../lineageos/updater/controller/UpdaterController.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/org/lineageos/updater/controller/UpdaterController.java b/src/org/lineageos/updater/controller/UpdaterController.java index 6e32bd8..419020e 100644 --- a/src/org/lineageos/updater/controller/UpdaterController.java +++ b/src/org/lineageos/updater/controller/UpdaterController.java @@ -296,12 +296,7 @@ public class UpdaterController implements UpdaterControllerInt { } if (!fixUpdateStatus(update) && local) { update.setPersistentStatus(UpdateStatus.Persistent.UNKNOWN); - new Thread(new Runnable() { - @Override - public void run() { - mUpdatesDbHelper.removeUpdate(update.getDownloadId()); - } - }).start(); + deleteUpdateAsync(update); Log.d(TAG, update.getDownloadId() + " had an invalid status and is local"); return false; }