diff options
-rw-r--r-- | src/org/traccar/database/ConnectionManager.java | 6 |
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) { |