From b09412b6ed5819d46738aed4774959eb527a2a0f Mon Sep 17 00:00:00 2001 From: madwasp79 Date: Fri, 28 Jun 2019 15:52:34 +0300 Subject: [PATCH] additional logging for #6201 --- .../plus/liveupdates/PerformLiveUpdateAsyncTask.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java b/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java index 99a81e9e29..21162ac1f5 100644 --- a/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java +++ b/OsmAnd/src/net/osmand/plus/liveupdates/PerformLiveUpdateAsyncTask.java @@ -85,6 +85,7 @@ public class PerformLiveUpdateAsyncTask settings.LIVE_UPDATES_RETRIES.resetToDefault(); List ll = result.getItemsForUpdate(); if (ll != null && !ll.isEmpty()) { + LOG.debug("Updates quantity: " + ll.size()); ArrayList itemsToDownload = new ArrayList<>(ll.size()); for (IncrementalChangesManager.IncrementalUpdate iu : ll) { IndexItem indexItem = new IndexItem(iu.fileName, "Incremental update", @@ -92,12 +93,16 @@ public class PerformLiveUpdateAsyncTask iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE); itemsToDownload.add(indexItem); } + LOG.debug("Items to download size: " + itemsToDownload.size()); DownloadIndexesThread downloadThread = application.getDownloadThread(); if (context instanceof DownloadIndexesThread.DownloadEvents) { downloadThread.setUiActivity((DownloadIndexesThread.DownloadEvents) context); } boolean downloadViaWiFi = LiveUpdatesHelper.preferenceDownloadViaWiFi(localIndexFileName, settings).get(); + + LOG.debug("Internet connection available: " + getMyApplication().getSettings().isInternetConnectionAvailable()); + LOG.debug("Download via Wifi: " + downloadViaWiFi); if (getMyApplication().getSettings().isInternetConnectionAvailable()) { if (userRequested || settings.isWifiConnected() || !downloadViaWiFi) { long szLong = 0; @@ -113,6 +118,8 @@ public class PerformLiveUpdateAsyncTask double sz = ((double) szLong) / (1 << 20); // get availabile space double asz = downloadThread.getAvailableSpace(); + + LOG.debug("Download size: " + sz + ", available space: " + asz); if (asz == -1 || asz <= 0 || sz / asz <= 0.4) { IndexItem[] itemsArray = new IndexItem[itemsToDownload.size()]; itemsArray = itemsToDownload.toArray(itemsArray); @@ -120,8 +127,10 @@ public class PerformLiveUpdateAsyncTask if (context instanceof DownloadIndexesThread.DownloadEvents) { ((DownloadIndexesThread.DownloadEvents) context).downloadInProgress(); } + } else { + LOG.debug("onPostExecute: Not enough space for updates"); } - } + } LOG.debug("onPostExecute: No internet connection"); } } else { if (context instanceof DownloadIndexesThread.DownloadEvents) {