diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index ab45abe6d0..568dcc9ed6 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -243,6 +243,9 @@ public class DownloadIndexesThread { if (item instanceof MultipleDownloadItem) { MultipleDownloadItem multipleDownloadItem = (MultipleDownloadItem) item; cancelDownload(multipleDownloadItem.getAllIndexes()); + } else if (item instanceof SrtmDownloadItem) { + IndexItem indexItem = ((SrtmDownloadItem) item).getIndexItem(); + cancelDownload(indexItem); } else if (item instanceof IndexItem) { IndexItem indexItem = (IndexItem) item; cancelDownload(indexItem); diff --git a/OsmAnd/src/net/osmand/plus/download/SrtmDownloadItem.java b/OsmAnd/src/net/osmand/plus/download/SrtmDownloadItem.java index aada6acd55..a9a184d57c 100644 --- a/OsmAnd/src/net/osmand/plus/download/SrtmDownloadItem.java +++ b/OsmAnd/src/net/osmand/plus/download/SrtmDownloadItem.java @@ -10,11 +10,10 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.activities.LocalIndexInfo; import net.osmand.plus.helpers.enums.MetricsConstants; -import net.osmand.util.Algorithms; import java.io.File; import java.text.DateFormat; -import java.util.Collections; +import java.util.ArrayList; import java.util.List; import static net.osmand.IndexConstants.BINARY_SRTM_MAP_INDEX_EXT; @@ -105,7 +104,6 @@ public class SrtmDownloadItem extends DownloadItem { @Override public String getFileName() { - // may be check only downloaded items if any downloaded return getIndexItem().getFileName(); } @@ -113,14 +111,11 @@ public class SrtmDownloadItem extends DownloadItem { @Override public List getDownloadedFiles(@NonNull OsmandApplication app) { // may be check both indexes files - List result; + List result = new ArrayList<>(); for (IndexItem index : indexes) { - result = index.getDownloadedFiles(app); - if (!Algorithms.isEmpty(result)) { - return result; - } + result.addAll(index.getDownloadedFiles(app)); } - return Collections.emptyList(); + return result; } public String getDate(@NonNull DateFormat dateFormat, boolean remote) {