From bd2e0fdc6fe222316e9e740aa265b6d132d407b6 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 23 Jun 2016 16:17:25 +0500 Subject: Added possibility to disable event and geofence subsystems --- src/org/traccar/database/ConnectionManager.java | 4 +++- src/org/traccar/database/NotificationManager.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index 8a1debdfa..8796673b1 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -94,7 +94,9 @@ public class ConnectionManager { if (status.equals(Device.STATUS_ONLINE)) { event.setType(Event.TYPE_DEVICE_ONLINE); } - Context.getNotificationManager().updateEvent(event, null); + if (Context.getNotificationManager() != null) { + Context.getNotificationManager().updateEvent(event, null); + } } device.setStatus(status); diff --git a/src/org/traccar/database/NotificationManager.java b/src/org/traccar/database/NotificationManager.java index 7593367a3..ab6b2230a 100644 --- a/src/org/traccar/database/NotificationManager.java +++ b/src/org/traccar/database/NotificationManager.java @@ -41,8 +41,8 @@ public class NotificationManager { Set users = Context.getPermissionsManager().getDeviceUsers(event.getDeviceId()); for (Long userId : users) { - if (event.getGeofenceId() == 0 - || Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { + if (event.getGeofenceId() == 0 || Context.getGeofenceManager() != null + && Context.getGeofenceManager().checkGeofence(userId, event.getGeofenceId())) { Context.getConnectionManager().updateEvent(userId, event, position); } } -- cgit v1.2.3