Merge branch 'r3.7'

This commit is contained in:
max-klaus 2020-06-12 17:16:23 +03:00
commit 368172f97c

View file

@ -82,10 +82,16 @@ public class TerrainLayer extends MapTileLayer {
File tilesDir = app.getAppPath(IndexConstants.TILES_INDEX_DIR);
File cacheDir = app.getCacheDir();
// fix http://stackoverflow.com/questions/26937152/workaround-for-nexus-9-sqlite-file-write-operations-on-external-dirs
try {
sqliteDb = SQLiteDatabase.openDatabase(
new File(cacheDir, mode == HILLSHADE ? HILLSHADE_CACHE : SLOPE_CACHE).getPath(),
null, SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING
| SQLiteDatabase.CREATE_IF_NECESSARY );
| SQLiteDatabase.CREATE_IF_NECESSARY);
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
sqliteDb = null;
}
if (sqliteDb != null) {
if (sqliteDb.getVersion() == 0) {
sqliteDb.setVersion(1);
}
@ -97,6 +103,7 @@ public class TerrainLayer extends MapTileLayer {
indexNonCachedResources(fileModified, rs);
sqliteDb.close();
resources = rs;
}
return null;
}