aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/handler/events')
-rw-r--r--src/main/java/org/traccar/handler/events/GeofenceEventHandler.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
index 724f8f0d0..0a924cfc3 100644
--- a/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/GeofenceEventHandler.java
@@ -16,6 +16,7 @@
package org.traccar.handler.events;
import io.netty.channel.ChannelHandler;
+import org.traccar.config.Config;
import org.traccar.helper.model.GeofenceUtil;
import org.traccar.helper.model.PositionUtil;
import org.traccar.model.Calendar;
@@ -35,11 +36,13 @@ import java.util.Map;
@ChannelHandler.Sharable
public class GeofenceEventHandler extends BaseEventHandler {
+ private final Config config;
private final CacheManager cacheManager;
private final ConnectionManager connectionManager;
@Inject
- public GeofenceEventHandler(CacheManager cacheManager, ConnectionManager connectionManager) {
+ public GeofenceEventHandler(Config config, CacheManager cacheManager, ConnectionManager connectionManager) {
+ this.config = config;
this.cacheManager = cacheManager;
this.connectionManager = connectionManager;
}
@@ -54,7 +57,7 @@ public class GeofenceEventHandler extends BaseEventHandler {
return null;
}
- List<Long> currentGeofences = GeofenceUtil.getCurrentGeofences(cacheManager, position);
+ List<Long> currentGeofences = GeofenceUtil.getCurrentGeofences(config, cacheManager, position);
List<Long> oldGeofences = new ArrayList<>();
if (device.getGeofenceIds() != null) {
oldGeofences.addAll(device.getGeofenceIds());