diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java index 18f06cc21e..98cc159720 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java @@ -118,6 +118,7 @@ public class DownloadIndexesThread { if (app.getDownloadService() != null) { app.getDownloadService().stopService(app); } + app.getAvoidSpecificRoads().initRouteObjects(true); } public void initSettingsFirstMap(WorldRegion reg) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index 382de8112d..c8891d3347 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -66,12 +66,17 @@ public class AvoidSpecificRoads { public void initRouteObjects(boolean force) { for (Map.Entry entry : impassableRoads.entrySet()) { AvoidRoadInfo roadInfo = entry.getValue(); + if (roadInfo.id != 0) { + for (RoutingConfiguration.Builder builder : app.getAllRoutingConfigs()) { + if (force) { + builder.removeImpassableRoad(roadInfo.id); + } else { + builder.addImpassableRoad(roadInfo.id); + } + } + } if (force || roadInfo.id == 0) { addImpassableRoad(null, entry.getKey(), false, true, roadInfo.appModeKey); - } else { - for (RoutingConfiguration.Builder builder : app.getAllRoutingConfigs()) { - builder.addImpassableRoad(roadInfo.id); - } } } }