diff --git a/android/app/src/main/java/app/organicmaps/MwmActivity.java b/android/app/src/main/java/app/organicmaps/MwmActivity.java index 0dd6378397..8e2dff583d 100644 --- a/android/app/src/main/java/app/organicmaps/MwmActivity.java +++ b/android/app/src/main/java/app/organicmaps/MwmActivity.java @@ -77,7 +77,6 @@ import app.organicmaps.maplayer.MapButtonsViewModel; import app.organicmaps.maplayer.ToggleMapLayerFragment; import app.organicmaps.maplayer.isolines.IsolinesManager; import app.organicmaps.maplayer.isolines.IsolinesState; -import app.organicmaps.maplayer.subway.SubwayManager; import app.organicmaps.routing.NavigationController; import app.organicmaps.routing.NavigationService; import app.organicmaps.routing.RoutePointInfo; @@ -1675,12 +1674,6 @@ public class MwmActivity extends BaseMwmFragmentActivity mRoutingPlanInplaceController.showDrivingOptionView(); } - @Override - public boolean isSubwayEnabled() - { - return SubwayManager.from(this).isEnabled(); - } - @Override public void onCommonBuildError(int lastResultCode, @NonNull String[] lastMissingMaps) { diff --git a/android/app/src/main/java/app/organicmaps/intent/Factory.java b/android/app/src/main/java/app/organicmaps/intent/Factory.java index 720ad7ae16..d8c213602c 100644 --- a/android/app/src/main/java/app/organicmaps/intent/Factory.java +++ b/android/app/src/main/java/app/organicmaps/intent/Factory.java @@ -99,7 +99,7 @@ public class Factory RoutingController.get().prepare(MapObject.createMapObject(FeatureId.EMPTY, MapObject.API_POINT, from.mName, "", from.mLat, from.mLon), MapObject.createMapObject(FeatureId.EMPTY, MapObject.API_POINT, - to.mName, "", to.mLat, to.mLon), true); + to.mName, "", to.mLat, to.mLon)); return true; case RequestType.SEARCH: { diff --git a/android/app/src/main/java/app/organicmaps/routing/RoutingController.java b/android/app/src/main/java/app/organicmaps/routing/RoutingController.java index 0468a02e5a..ac5df5fa8f 100644 --- a/android/app/src/main/java/app/organicmaps/routing/RoutingController.java +++ b/android/app/src/main/java/app/organicmaps/routing/RoutingController.java @@ -60,7 +60,7 @@ public class RoutingController default void onResetToPlanningState() {} default void onBuiltRoute() {} default void onDrivingOptionsWarning() {} - default boolean isSubwayEnabled() { return false; } + default void onCommonBuildError(int lastResultCode, @NonNull String[] lastMissingMaps) {} default void onDrivingOptionsBuildError() {} @@ -333,45 +333,23 @@ public class RoutingController { setState(State.NONE); setBuildState(BuildState.NONE); - prepare(getStartPoint(), getEndPoint(), false); + prepare(getStartPoint(), getEndPoint()); } public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint) - { - prepare(startPoint, endPoint, false); - } - - public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint, boolean fromApi) { Logger.d(TAG, "prepare (" + (endPoint == null ? "route)" : "p2p)")); - initLastRouteType(startPoint, endPoint, fromApi); + initLastRouteType(startPoint, endPoint); prepare(startPoint, endPoint, mLastRouterType); } - private void initLastRouteType(@Nullable MapObject startPoint, @Nullable MapObject endPoint, - boolean fromApi) + private void initLastRouteType(@Nullable MapObject startPoint, @Nullable MapObject endPoint) { - if (shouldForceTransitRoute(fromApi)) - { - mLastRouterType = Framework.ROUTER_TYPE_TRANSIT; - return; - } - if (startPoint != null && endPoint != null) mLastRouterType = Framework.nativeGetBestRouter(startPoint.getLat(), startPoint.getLon(), endPoint.getLat(), endPoint.getLon()); } - private boolean isSubwayEnabled() - { - return mContainer != null && mContainer.isSubwayEnabled(); - } - - private boolean shouldForceTransitRoute(boolean fromApi) - { - return mState == State.NONE && isSubwayEnabled() && !fromApi; - } - public void prepare(final @Nullable MapObject startPoint, final @Nullable MapObject endPoint, @Framework.RouterType int routerType) {