Merge branch 'r3.7'
This commit is contained in:
commit
368172f97c
1 changed files with 20 additions and 13 deletions
|
@ -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);
|
||||
} 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue