diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java index 71d7cdcc3f..da3cb1f23a 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java @@ -256,7 +256,7 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment { } return files; } - + public static File findFileInDir(File file) { if(file.isDirectory()) { File[] lf = file.listFiles(); diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 08b4419952..1cc814212f 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -551,7 +551,17 @@ public class DownloadIndexesThread { !date.equals(indexactivateddate) && !date.equals(indexfilesdate) && indexActivatedFileNames.containsKey(sfName)) { - itemsToUpdate.add(item); + if (item.getType() == DownloadActivityType.NORMAL_FILE){ + itemsToUpdate.add(item); + } else { + long itemSize = item.getSize(); + File file = new File(((DownloadOsmandIndexesHelper.AssetIndexItem) item).getDestFile()); + long oldItemSize = file.length(); + if (itemSize != oldItemSize){ + itemsToUpdate.add(item); + } + } + } } if (uiActivity != null){ diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java index d22efa7d4f..650660de05 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java @@ -165,6 +165,10 @@ public class DownloadOsmandIndexesHelper { res.add(new DownloadEntry(this, assetName, destFile, dateModified)); return res; } + + public String getDestFile(){ + return destFile; + } } diff --git a/OsmAnd/src/net/osmand/plus/download/IndexItem.java b/OsmAnd/src/net/osmand/plus/download/IndexItem.java index 312dbc65dc..df440f3c4a 100644 --- a/OsmAnd/src/net/osmand/plus/download/IndexItem.java +++ b/OsmAnd/src/net/osmand/plus/download/IndexItem.java @@ -57,7 +57,10 @@ public class IndexItem implements Comparable { return timestamp; } - + public long getSize(){ + return containerSize; + } + public String getSizeDescription(Context ctx) { return size + " MB"; }