Merge pull request #9230 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2020-06-12 21:59:42 +02:00 committed by GitHub
commit 33edd422a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 18 deletions

View file

@ -82,21 +82,28 @@ public class TerrainLayer extends MapTileLayer {
File tilesDir = app.getAppPath(IndexConstants.TILES_INDEX_DIR); File tilesDir = app.getAppPath(IndexConstants.TILES_INDEX_DIR);
File cacheDir = app.getCacheDir(); File cacheDir = app.getCacheDir();
// fix http://stackoverflow.com/questions/26937152/workaround-for-nexus-9-sqlite-file-write-operations-on-external-dirs // fix http://stackoverflow.com/questions/26937152/workaround-for-nexus-9-sqlite-file-write-operations-on-external-dirs
sqliteDb = SQLiteDatabase.openDatabase( try {
new File(cacheDir, mode == HILLSHADE ? HILLSHADE_CACHE : SLOPE_CACHE).getPath(), sqliteDb = SQLiteDatabase.openDatabase(
null, SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING new File(cacheDir, mode == HILLSHADE ? HILLSHADE_CACHE : SLOPE_CACHE).getPath(),
| SQLiteDatabase.CREATE_IF_NECESSARY ); null, SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING
if (sqliteDb.getVersion() == 0) { | SQLiteDatabase.CREATE_IF_NECESSARY);
sqliteDb.setVersion(1); } catch (RuntimeException e) {
log.error(e.getMessage(), e);
sqliteDb = null;
} }
sqliteDb.execSQL("CREATE TABLE IF NOT EXISTS TILE_SOURCES(filename varchar2(256), date_modified int, left int, right int, top int, bottom int)"); if (sqliteDb != null) {
if (sqliteDb.getVersion() == 0) {
sqliteDb.setVersion(1);
}
sqliteDb.execSQL("CREATE TABLE IF NOT EXISTS TILE_SOURCES(filename varchar2(256), date_modified int, left int, right int, top int, bottom int)");
Map<String, Long> fileModified = new HashMap<String, Long>(); Map<String, Long> fileModified = new HashMap<String, Long>();
Map<String, SQLiteTileSource> rs = readFiles(app, tilesDir, fileModified); Map<String, SQLiteTileSource> rs = readFiles(app, tilesDir, fileModified);
indexCachedResources(fileModified, rs); indexCachedResources(fileModified, rs);
indexNonCachedResources(fileModified, rs); indexNonCachedResources(fileModified, rs);
sqliteDb.close(); sqliteDb.close();
resources = rs; resources = rs;
}
return null; return null;
} }

View file

@ -48,8 +48,6 @@ import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.OsmAndLocationProvider.GPSInfo; import net.osmand.plus.OsmAndLocationProvider.GPSInfo;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.settings.backend.OsmandSettings.RulerMode;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
@ -65,6 +63,8 @@ import net.osmand.plus.routepreparationmenu.ShowAlongTheRouteBottomSheet;
import net.osmand.plus.routing.RouteCalculationResult; import net.osmand.plus.routing.RouteCalculationResult;
import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.settings.backend.OsmandSettings;
import net.osmand.plus.settings.backend.OsmandSettings.RulerMode;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.RulerControlLayer; import net.osmand.plus.views.RulerControlLayer;
@ -72,8 +72,6 @@ import net.osmand.plus.views.mapwidgets.MapWidgetRegistry.WidgetState;
import net.osmand.plus.views.mapwidgets.NextTurnInfoWidget.TurnDrawable; import net.osmand.plus.views.mapwidgets.NextTurnInfoWidget.TurnDrawable;
import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRuleSearchRequest;
import net.osmand.render.RenderingRulesStorage; import net.osmand.render.RenderingRulesStorage;
import net.osmand.router.ExitInfo;
import net.osmand.router.TurnType;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils; import net.osmand.util.MapUtils;
@ -1036,7 +1034,8 @@ public class MapInfoWidgetsFactory {
AndroidUiHelper.updateVisibility(addressText, true); AndroidUiHelper.updateVisibility(addressText, true);
AndroidUiHelper.updateVisibility(addressTextShadow, shadowRad > 0); AndroidUiHelper.updateVisibility(addressTextShadow, shadowRad > 0);
if (streetName.shieldObject != null && setRoadShield(shieldIcon, streetName.shieldObject)) { if (streetName.shieldObject != null && streetName.shieldObject.nameIds != null
&& setRoadShield(shieldIcon, streetName.shieldObject)) {
AndroidUiHelper.updateVisibility(shieldIcon, true); AndroidUiHelper.updateVisibility(shieldIcon, true);
} else { } else {
AndroidUiHelper.updateVisibility(shieldIcon, false); AndroidUiHelper.updateVisibility(shieldIcon, false);