diff options
Diffstat (limited to 'src/org/traccar/events')
-rw-r--r-- | src/org/traccar/events/MotionEventHandler.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java index 8c2d4c56c..b96898fc1 100644 --- a/src/org/traccar/events/MotionEventHandler.java +++ b/src/org/traccar/events/MotionEventHandler.java @@ -61,11 +61,14 @@ public class MotionEventHandler extends BaseEventHandler { } public Event updateMotionState(DeviceState deviceState, Position position) { + return updateMotionState(deviceState, position, position.getBoolean(Position.KEY_MOTION)); + } + + public Event updateMotionState(DeviceState deviceState, Position position, boolean newMotion) { Event result = null; Boolean oldMotion = deviceState.getMotionState(); long currentTime = position.getFixTime().getTime(); - boolean newMotion = position.getBoolean(Position.KEY_MOTION); if (newMotion != oldMotion) { if (deviceState.getMotionPosition() == null) { deviceState.setMotionPosition(position); |