From aea3cb9f3dcb641e9a17a80e94f4a813a6a49edd Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 21 Jul 2019 22:49:56 +0200 Subject: [PATCH] Add java setting --- OsmAnd/src/net/osmand/plus/OsmandSettings.java | 3 ++- OsmAnd/src/net/osmand/plus/routing/RouteProvider.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) 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; }