Update track utility saving (use setting instead of hardcode value)

This commit is contained in:
Victor Shcherb 2019-07-31 15:06:08 +02:00
parent 963acad11f
commit fb2d4764b3
3 changed files with 3 additions and 3 deletions

View file

@ -1303,7 +1303,7 @@ public class OsmandSettings {
// SAVE_TRACK_MIN_DISTANCE.setModeDefaultValue(ApplicationMode.BICYCLE, 5.f);
// SAVE_TRACK_MIN_DISTANCE.setModeDefaultValue(ApplicationMode.PEDESTRIAN, 5.f);
//}
public final CommonPreference<Float> SAVE_TRACK_PRECISION = new FloatPreference("save_track_precision", 0.f).makeGlobal();
public final CommonPreference<Float> SAVE_TRACK_PRECISION = new FloatPreference("save_track_precision", 50.0f).makeGlobal();
//{
// SAVE_TRACK_PRECISION.setModeDefaultValue(ApplicationMode.CAR, 50.f);
// SAVE_TRACK_PRECISION.setModeDefaultValue(ApplicationMode.BICYCLE, 50.f);

View file

@ -407,7 +407,7 @@ public class SavingTrackHelper extends SQLiteOpenHelper {
long locationTime = System.currentTimeMillis();
OsmandSettings settings = ctx.getSettings();
boolean record = false;
if(OsmAndLocationProvider.isPointAccurateForRouting(location) &&
if(location != null &&
OsmAndLocationProvider.isNotSimulatedLocation(location) ) {
if (OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class) != null) {
if (settings.SAVE_TRACK_TO_GPX.get()

View file

@ -47,7 +47,7 @@ public class LiveMonitoringHelper {
public void updateLocation(net.osmand.Location location) {
boolean record = false;
long locationTime = System.currentTimeMillis();
if (OsmAndLocationProvider.isPointAccurateForRouting(location) && isLiveMonitoringEnabled()
if (location != null && isLiveMonitoringEnabled()
&& OsmAndLocationProvider.isNotSimulatedLocation(location)
&& OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class) != null) {
if (locationTime - lastTimeUpdated > settings.LIVE_MONITORING_INTERVAL.get()) {