aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-16 20:59:38 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-05-16 20:59:38 +1200
commit1306899a67b28ad9cc0e6467291f3c8597df5479 (patch)
tree1974de7791e865d8b5e61d81efc7b58e67c7abfa /src/org/traccar/database
parent1fb4b23ee69f10f04c69ba2ca1d528737259a5b1 (diff)
downloadtraccar-server-1306899a67b28ad9cc0e6467291f3c8597df5479.tar.gz
traccar-server-1306899a67b28ad9cc0e6467291f3c8597df5479.tar.bz2
traccar-server-1306899a67b28ad9cc0e6467291f3c8597df5479.zip
Update device status before event (fix #3165)
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/ConnectionManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java
index 9e4b65b2c..cfa8cc7a0 100644
--- a/src/org/traccar/database/ConnectionManager.java
+++ b/src/org/traccar/database/ConnectionManager.java
@@ -75,7 +75,10 @@ public class ConnectionManager {
return;
}
- if (enableStatusEvents && !status.equals(device.getStatus())) {
+ String oldStatus = device.getStatus();
+ device.setStatus(status);
+
+ if (enableStatusEvents && !status.equals(oldStatus)) {
String eventType;
switch (status) {
case Device.STATUS_ONLINE:
@@ -93,7 +96,6 @@ public class ConnectionManager {
Context.getNotificationManager().updateEvent(event, null);
}
}
- device.setStatus(status);
Timeout timeout = timeouts.remove(deviceId);
if (timeout != null) {