From 000ea0b6de98ed6c8765a9f1913831d9487d8767 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 20 Mar 2020 18:09:27 +0100 Subject: [PATCH] Fixed downloads taking long before being shown as started The first call to installSslProvider may take quite long. Already report the started download. --- .../antennapod/core/service/download/DownloadService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 87ce10a5c..d4177df46 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -474,7 +474,6 @@ public class DownloadService extends Service { @NonNull List itemsEnqueued) { writeFileUrl(request); - ClientConfig.installSslProvider(this); Downloader downloader = downloaderFactory.create(request); if (downloader != null) { numberOfDownloads.incrementAndGet(); @@ -485,9 +484,12 @@ public class DownloadService extends Service { } handler.post(() -> { downloads.add(downloader); - downloadExecutor.submit(downloader); postDownloaders(); }); + // Needs to be done after postDownloaders() because otherwise, + // it might take long before the progress bar circle starts spinning + ClientConfig.installSslProvider(this); + handler.post(() -> downloadExecutor.submit(downloader)); } handler.post(this::queryDownloads); }