From bb2f2c10058effc59d9faf198941bb47352e5296 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Tue, 4 Jul 2017 19:05:04 +0200 Subject: [PATCH] Disable indeterminate progressbar in case of download error Similar to the 'paused' case, but take into account that the error can happen when the progress is 0, in which case we just hide the progress bar. --- src/org/lineageos/updater/controller/UpdaterService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/org/lineageos/updater/controller/UpdaterService.java b/src/org/lineageos/updater/controller/UpdaterService.java index d29ef9c6..a0444b72 100644 --- a/src/org/lineageos/updater/controller/UpdaterService.java +++ b/src/org/lineageos/updater/controller/UpdaterService.java @@ -211,6 +211,9 @@ public class UpdaterService extends Service { } case PAUSED_ERROR: { stopForeground(STOP_FOREGROUND_DETACH); + int progress = update.getProgress(); + // In case we pause before the first progress update + mNotificationBuilder.setProgress(progress > 0 ? 100 : 0, progress, false); mNotificationBuilder.mActions.clear(); String text = getString(R.string.download_paused_error_notification); mNotificationStyle.bigText(text);