diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index ccd166818a..22e0607c7f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -417,7 +417,9 @@ public class AvoidSpecificRoads { AvoidRoadInfo other = (AvoidRoadInfo) obj; return Math.abs(latitude - other.latitude) < 0.00001 && Math.abs(longitude - other.longitude) < 0.00001 - && Algorithms.objectEquals(name, other.name); + && Algorithms.objectEquals(name, other.name) + && Algorithms.objectEquals(appModeKey, other.appModeKey) + && id == other.id; } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java index 61b5f28541..6507ab874e 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/backup/AvoidRoadsSettingsItem.java @@ -68,13 +68,9 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem(newItems); for (AvoidSpecificRoads.AvoidRoadInfo duplicate : duplicateItems) { - if (shouldReplace) { - LatLon latLon = new LatLon(duplicate.latitude, duplicate.longitude); - if (settings.removeImpassableRoad(latLon)) { - settings.addImpassableRoad(duplicate); - } - } else { - settings.addImpassableRoad(renameItem(duplicate)); + LatLon latLon = new LatLon(duplicate.latitude, duplicate.longitude); + if (settings.removeImpassableRoad(latLon)) { + settings.addImpassableRoad(duplicate); } } for (AvoidSpecificRoads.AvoidRoadInfo avoidRoad : appliedItems) { @@ -87,7 +83,12 @@ public class AvoidRoadsSettingsItem extends CollectionSettingsItem