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.
This commit is contained in:
Gabriele M
2017-07-07 22:05:22 +02:00
parent 805e672148
commit ab9ac395f0

View File

@@ -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;
}