diff options
Diffstat (limited to 'src/main/java/org/traccar/session/ConnectionManager.java')
-rw-r--r-- | src/main/java/org/traccar/session/ConnectionManager.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/main/java/org/traccar/session/ConnectionManager.java b/src/main/java/org/traccar/session/ConnectionManager.java index 8431a0327..a80c6aad1 100644 --- a/src/main/java/org/traccar/session/ConnectionManager.java +++ b/src/main/java/org/traccar/session/ConnectionManager.java @@ -241,17 +241,11 @@ public class ConnectionManager implements BroadcastInterface { if (!status.equals(oldStatus)) { String eventType; Map<Event, Position> events = new HashMap<>(); - switch (status) { - case Device.STATUS_ONLINE: - eventType = Event.TYPE_DEVICE_ONLINE; - break; - case Device.STATUS_UNKNOWN: - eventType = Event.TYPE_DEVICE_UNKNOWN; - break; - default: - eventType = Event.TYPE_DEVICE_OFFLINE; - break; - } + eventType = switch (status) { + case Device.STATUS_ONLINE -> Event.TYPE_DEVICE_ONLINE; + case Device.STATUS_UNKNOWN -> Event.TYPE_DEVICE_UNKNOWN; + default -> Event.TYPE_DEVICE_OFFLINE; + }; events.put(new Event(eventType, deviceId), null); notificationManager.updateEvents(events); } |