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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user