aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-30 14:48:42 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-30 14:48:42 -0700
commit0202dbf7258df8cbe8168ddc985e774b1cadf964 (patch)
tree4828e614e29715e6bdfd10c5db86b52e43229ab3 /src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java
parent014cf82a9e63a36e944e293932f9edf27e452919 (diff)
downloadtrackermap-server-0202dbf7258df8cbe8168ddc985e774b1cadf964.tar.gz
trackermap-server-0202dbf7258df8cbe8168ddc985e774b1cadf964.tar.bz2
trackermap-server-0202dbf7258df8cbe8168ddc985e774b1cadf964.zip
Decouple more tests from context
Diffstat (limited to 'src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java
index a25cab06f..528098363 100644
--- a/src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -19,7 +19,6 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.Context;
import org.traccar.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
@@ -40,7 +39,7 @@ import java.util.regex.Pattern;
public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
- private Map<Byte, ByteBuf> photos = new HashMap<>();
+ private final Map<Byte, ByteBuf> photos = new HashMap<>();
public MeiligaoProtocolDecoder(Protocol protocol) {
super(protocol);
@@ -469,7 +468,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
} else if (command == MSG_POSITION_IMAGE) {
byte imageIndex = buf.readByte();
buf.readUnsignedByte(); // image upload type
- String uniqueId = Context.getIdentityManager().getById(deviceSession.getDeviceId()).getUniqueId();
+ String uniqueId = getIdentityManager().getById(deviceSession.getDeviceId()).getUniqueId();
ByteBuf photo = photos.remove(imageIndex);
try {
position.set(Position.KEY_IMAGE, writeMediaFile(uniqueId, photo, "jpg"));