From 370fded329afcf164f81eeb06b3b1556fa87f3a6 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Fri, 14 Sep 2018 13:33:39 +0300 Subject: [PATCH] Remove redundant callback --- .../osmand/plus/helpers/AvoidSpecificRoads.java | 14 +++----------- .../PointDescriptionMenuController.java | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index 7b10e23a8f..f60b031a74 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -44,7 +44,7 @@ public class AvoidSpecificRoads { public void initPreservedData() { List impassibleRoads = app.getSettings().getImpassableRoadPoints(); for (LatLon impassibleRoad : impassibleRoads) { - addImpassableRoad(null, impassibleRoad, false, null, true); + addImpassableRoad(null, impassibleRoad, false, true); } } @@ -152,7 +152,7 @@ public class AvoidSpecificRoads { @Override public boolean processResult(LatLon result) { - addImpassableRoad(mapActivity, result, true, null, false); + addImpassableRoad(mapActivity, result, true, false); return true; } @@ -162,7 +162,6 @@ public class AvoidSpecificRoads { public void addImpassableRoad(@Nullable final MapActivity activity, @NonNull final LatLon loc, final boolean showDialog, - @Nullable final AvoidSpecificRoadsCallback callback, final boolean skipWritingSettings) { final Location ll = new Location(""); ll.setLatitude(loc.getLatitude()); @@ -177,22 +176,15 @@ public class AvoidSpecificRoads { if (activity != null) { Toast.makeText(activity, R.string.error_avoid_specific_road, Toast.LENGTH_LONG).show(); } - if (callback != null) { - callback.onAddImpassableRoad(false, null); - } } else { addImpassableRoadInternal(object, ll, showDialog, activity, loc); - - if (callback != null) { - callback.onAddImpassableRoad(true, object); - } } return true; } @Override public boolean isCancelled() { - return callback != null && callback.isCancelled(); + return false; } }); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java index c055ea7ad6..86026d1a31 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/PointDescriptionMenuController.java @@ -33,7 +33,7 @@ public class PointDescriptionMenuController extends MenuController { MapActivity activity = getMapActivity(); if (activity != null) { AvoidSpecificRoads roads = activity.getMyApplication().getAvoidSpecificRoads(); - roads.addImpassableRoad(activity, getLatLon(), false, null, false); + roads.addImpassableRoad(activity, getLatLon(), false, false); } } };