From 87202371dedc4cef616497d1c56fce4ce878e851 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Fri, 18 Aug 2017 14:31:54 +0200 Subject: [PATCH] Don't change status when cancelled downloads fail It takes a bit of time to actually pause (i.e. cancel) a download. If we change the update status once the download is actually cancelled, we might override any status change that happened between the user request and its completion. For example, the following can happen when the user deletes an ongoing downloads: - pauseDownload(): DOWNLOADING -> PAUSED - deleteUpdate(): PAUSED -> DELETED - onFailure(): DELETED -> PAUSED Don't change the status of cancelled downloads from the onFailure() callback not to have an incorrect final status. Change-Id: Iee90482d82df984672c59d7c508ad834fa08061f --- src/org/lineageos/updater/controller/UpdaterController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/org/lineageos/updater/controller/UpdaterController.java b/src/org/lineageos/updater/controller/UpdaterController.java index ddd045c3..8364b15d 100644 --- a/src/org/lineageos/updater/controller/UpdaterController.java +++ b/src/org/lineageos/updater/controller/UpdaterController.java @@ -195,7 +195,6 @@ public class UpdaterController implements Controller { Update update = mDownloads.get(downloadId).mUpdate; if (cancelled) { Log.d(TAG, "Download cancelled"); - update.setStatus(UpdateStatus.PAUSED); // Already notified } else { Log.e(TAG, "Download failed");