diff --git a/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java b/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java index 279b96c351..d18f12f68e 100644 --- a/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java +++ b/OsmAnd-java/src/main/java/net/osmand/map/MapTileDownloader.java @@ -11,15 +11,12 @@ import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Set; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingDeque; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -310,4 +307,5 @@ public class MapTileDownloader { } } } + } diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java index 93ac107f5c..6ca36972c0 100644 --- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java +++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java @@ -43,7 +43,7 @@ public class SQLiteTileSource implements ITileSource { private int maxZoom = 17; private boolean inversiveZoom = true; // BigPlanet private boolean timeSupported = false; - private int expirationTimeMillis = -1; // never + private long expirationTimeMillis = -1; // never private boolean isEllipsoid = false; private String rule = null; private String referer = null; @@ -208,7 +208,7 @@ public class SQLiteTileSource implements ITileSource { timeSupported = "yes".equalsIgnoreCase(cursor.getString(timecolumn)); } else { timeSupported = hasTimeColumn(); - addInfoColumn("timecolumn", timeSupported?"yes" : "no"); + addInfoColumn("timecolumn", timeSupported? "yes" : "no"); } int expireminutes = list.indexOf("expireminutes"); this.expirationTimeMillis = -1; @@ -475,9 +475,11 @@ public class SQLiteTileSource implements ITileSource { if(db == null || db.isReadOnly()){ return; } - LOG.debug("DELETE FROM tiles WHERE time<" + (System.currentTimeMillis() - getExpirationTimeMillis())); - db.execSQL("DELETE FROM tiles WHERE time<"+(System.currentTimeMillis()-getExpirationTimeMillis())); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ - db.execSQL("VACUUM"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$ + String sql = "DELETE FROM tiles WHERE time < "+ + (System.currentTimeMillis() - getExpirationTimeMillis()); + LOG.debug(sql); + db.execSQL(sql); + db.execSQL("VACUUM"); } @Override