From 09eebb35449c4ffb43b6a72bb4c3f723ec1c84be Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 6 Jul 2022 16:19:56 -0700 Subject: Remove motion fallback (fix #3257) --- src/main/java/org/traccar/reports/common/ReportUtils.java | 7 +------ src/test/java/org/traccar/reports/ReportUtilsTest.java | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/traccar/reports/common/ReportUtils.java b/src/main/java/org/traccar/reports/common/ReportUtils.java index cd6b6ffd5..ce5e3d8d4 100644 --- a/src/main/java/org/traccar/reports/common/ReportUtils.java +++ b/src/main/java/org/traccar/reports/common/ReportUtils.java @@ -341,12 +341,7 @@ public class ReportUtils { return false; } } - if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION) - && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) { - return positions.get(index).getBoolean(Position.KEY_MOTION); - } else { - return positions.get(index).getSpeed() > tripsConfig.getSpeedThreshold(); - } + return positions.get(index).getBoolean(Position.KEY_MOTION); } public Collection detectTripsAndStops( diff --git a/src/test/java/org/traccar/reports/ReportUtilsTest.java b/src/test/java/org/traccar/reports/ReportUtilsTest.java index b73ae7cc0..aecb1c4a4 100644 --- a/src/test/java/org/traccar/reports/ReportUtilsTest.java +++ b/src/test/java/org/traccar/reports/ReportUtilsTest.java @@ -57,6 +57,7 @@ public class ReportUtilsTest extends BaseTest { position.setTime(date(time)); position.setValid(true); position.setSpeed(speed); + position.set(Position.KEY_MOTION, speed > 0); position.set(Position.KEY_TOTAL_DISTANCE, totalDistance); return position; -- cgit v1.2.3