diff options
author | Anton Tananaev <anton@traccar.org> | 2024-04-03 21:17:52 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-04-03 21:17:52 -0700 |
commit | fc3a24148526b3d41ba40ed1f55cf40b54c6a255 (patch) | |
tree | 6b285bdf25112ada01c7afe0665213be20c27cae /src/main/java/org/traccar/BaseProtocolDecoder.java | |
parent | 5606f054244fc1ea2d5929152dd5c997d04f66fa (diff) | |
download | trackermap-server-fc3a24148526b3d41ba40ed1f55cf40b54c6a255.tar.gz trackermap-server-fc3a24148526b3d41ba40ed1f55cf40b54c6a255.tar.bz2 trackermap-server-fc3a24148526b3d41ba40ed1f55cf40b54c6a255.zip |
Handle outdated positions in buffer
Diffstat (limited to 'src/main/java/org/traccar/BaseProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/BaseProtocolDecoder.java | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/main/java/org/traccar/BaseProtocolDecoder.java b/src/main/java/org/traccar/BaseProtocolDecoder.java index 495a866c0..b764e5cdf 100644 --- a/src/main/java/org/traccar/BaseProtocolDecoder.java +++ b/src/main/java/org/traccar/BaseProtocolDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2022 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2024 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,25 +154,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { public void getLastLocation(Position position, Date deviceTime) { if (position.getDeviceId() != 0) { position.setOutdated(true); - - Position last = cacheManager.getPosition(position.getDeviceId()); - if (last != null) { - position.setFixTime(last.getFixTime()); - position.setValid(last.getValid()); - position.setLatitude(last.getLatitude()); - position.setLongitude(last.getLongitude()); - position.setAltitude(last.getAltitude()); - position.setSpeed(last.getSpeed()); - position.setCourse(last.getCourse()); - position.setAccuracy(last.getAccuracy()); - } else { - position.setFixTime(new Date(0)); - } - if (deviceTime != null) { position.setDeviceTime(deviceTime); - } else { - position.setDeviceTime(new Date()); } } } |