diff options
author | Abyss777 <abyss@fox5.ru> | 2016-06-14 18:05:05 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-06-14 18:05:05 +0500 |
commit | b588b3c723cad4629dcecbce8983933f7ff2a255 (patch) | |
tree | ee1ed23c7c02ded8ca92c904e6f4f21aacfda8d8 /src/org/traccar/database/ConnectionManager.java | |
parent | 185c0830e17b6969977026d4be27e34878bb3db9 (diff) | |
download | trackermap-server-b588b3c723cad4629dcecbce8983933f7ff2a255.tar.gz trackermap-server-b588b3c723cad4629dcecbce8983933f7ff2a255.tar.bz2 trackermap-server-b588b3c723cad4629dcecbce8983933f7ff2a255.zip |
- Overlapping geofences
- Simplified user-device link
Diffstat (limited to 'src/org/traccar/database/ConnectionManager.java')
-rw-r--r-- | src/org/traccar/database/ConnectionManager.java | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index 6e47dfad3..4f12c44d4 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -94,7 +94,7 @@ public class ConnectionManager { if (status.equals(Device.STATUS_ONLINE)) { event.setType(Event.TYPE_DEVICE_ONLINE); } - updateEvent(event, null); + Context.getNotificationManager().updateEvent(event, null); } device.setStatus(status); @@ -147,19 +147,10 @@ public class ConnectionManager { } } - public synchronized void updateEvent(Event event, Position position) { - long deviceId = event.getDeviceId(); - try { - Context.getDataManager().addEvent(event); - } catch (SQLException error) { - Log.warning(error); - } - for (long userId : Context.getPermissionsManager().getDeviceUsers(deviceId)) { - if (listeners.containsKey(userId) && (event.getGeofenceId() == 0 - || Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId()))) { - for (UpdateListener listener : listeners.get(userId)) { - listener.onUpdateEvent(event, position); - } + public synchronized void updateEvent(long userId, Event event, Position position) { + if (listeners.containsKey(userId)) { + for (UpdateListener listener : listeners.get(userId)) { + listener.onUpdateEvent(event, position); } } } |