diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index a3c93cdbda..f0d1e6a401 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1222,8 +1222,9 @@ public class OsmandSettings { // this value string is synchronized with settings_pref.xml preference name public final OsmandPreference FAST_ROUTE_MODE = new BooleanPreference("fast_route_mode", true).makeProfile(); - // temporarily for new version + // dev version public final CommonPreference DISABLE_COMPLEX_ROUTING = new BooleanPreference("disable_complex_routing", false).makeGlobal(); + public final CommonPreference ENABLE_TIME_CONDITIONAL_ROUTING = new BooleanPreference("enable_time_conditional_routing", true).makeGlobal(); public final CommonPreference SHOW_TRAFFIC_WARNINGS = new BooleanPreference("show_traffic_warnings", false).makeProfile().cache(); diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java index 8bb9e00146..95f09a68a0 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteProvider.java @@ -709,7 +709,6 @@ public class RouteProvider { if (maxSpeed > 0) { paramsR.put(GeneralRouter.MAX_SPEED, String.valueOf(maxSpeed)); } - float mb = (1 << 20); Runtime rt = Runtime.getRuntime(); // make visible @@ -718,6 +717,9 @@ public class RouteProvider { RoutingConfiguration cf = config.build( params.mode.getRoutingProfile(), params.start.hasBearing() ? params.start.getBearing() / 180d * Math.PI : null, memoryLimit, paramsR); + if(settings.ENABLE_TIME_CONDITIONAL_ROUTING.get()) { + cf.routeCalculationTime = System.currentTimeMillis(); + } return cf; }