Fix compilation

This commit is contained in:
Victor Shcherb 2018-08-26 19:25:44 +02:00
parent efb2c61bc4
commit 0dcbf90f03
4 changed files with 9 additions and 9 deletions

View file

@ -24,7 +24,7 @@ public interface ITileSource {
public boolean couldBeDownloadedFromInternet();
public int getExpirationTimeMillis();
public long getExpirationTimeMillis();
public int getExpirationTimeMinutes();

View file

@ -61,7 +61,7 @@ public class TileSourceManager {
private int avgSize;
private int bitDensity;
// -1 never expires,
private int expirationTimeMillis = -1;
private long expirationTimeMillis = -1;
private boolean ellipticYTile;
private String rule;
private boolean hidden; // if hidden in configure map settings, for example mapillary sources
@ -141,7 +141,7 @@ public class TileSourceManager {
return name;
}
public void setExpirationTimeMillis(int timeMillis) {
public void setExpirationTimeMillis(long timeMillis) {
this.expirationTimeMillis = timeMillis;
}
@ -149,7 +149,7 @@ public class TileSourceManager {
if(minutes < 0) {
this.expirationTimeMillis = -1;
} else {
this.expirationTimeMillis = minutes * 60 * 1000;
this.expirationTimeMillis = minutes * 60 * 1000l;
}
}
@ -157,10 +157,10 @@ public class TileSourceManager {
if(expirationTimeMillis < 0) {
return -1;
}
return expirationTimeMillis / (60 * 1000);
return (int) (expirationTimeMillis / (60 * 1000));
}
public int getExpirationTimeMillis() {
public long getExpirationTimeMillis() {
return expirationTimeMillis;
}

View file

@ -215,7 +215,7 @@ public class SQLiteTileSource implements ITileSource {
if(expireminutes != -1) {
int minutes = (int) cursor.getInt(expireminutes);
if(minutes > 0) {
this.expirationTimeMillis = minutes * 60 * 1000;
this.expirationTimeMillis = minutes * 60 * 1000l;
}
} else {
addInfoColumn("expireminutes", "0");
@ -503,7 +503,7 @@ public class SQLiteTileSource implements ITileSource {
return (int) (expirationTimeMillis / (60 * 1000));
}
public int getExpirationTimeMillis() {
public long getExpirationTimeMillis() {
return expirationTimeMillis;
}

View file

@ -205,7 +205,7 @@ public abstract class TilesCache<T> {
protected boolean isExpired(TileLoadDownloadRequest req, long lastModified) {
long time = System.currentTimeMillis();
int ts = req.tileSource.getExpirationTimeMillis();
long ts = req.tileSource.getExpirationTimeMillis();
return ts != -1 && req.url != null && time - lastModified > ts;
}