Add java setting

This commit is contained in:
Victor Shcherb 2019-07-21 22:49:56 +02:00
parent 8e0c1524ee
commit aea3cb9f3d
2 changed files with 5 additions and 2 deletions

View file

@ -1222,8 +1222,9 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference<Boolean> FAST_ROUTE_MODE = new BooleanPreference("fast_route_mode", true).makeProfile();
// temporarily for new version
// dev version
public final CommonPreference<Boolean> DISABLE_COMPLEX_ROUTING = new BooleanPreference("disable_complex_routing", false).makeGlobal();
public final CommonPreference<Boolean> ENABLE_TIME_CONDITIONAL_ROUTING = new BooleanPreference("enable_time_conditional_routing", true).makeGlobal();
public final CommonPreference<Boolean> SHOW_TRAFFIC_WARNINGS = new BooleanPreference("show_traffic_warnings", false).makeProfile().cache();

View file

@ -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;
}