diff options
author | Abyss777 <abyss@fox5.ru> | 2018-02-02 16:38:55 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-02-02 16:38:55 +0500 |
commit | bec12783f99849131f80175731d00b3f7929e661 (patch) | |
tree | 185d255ed2b6d1069c48cc39f5ef0545e0574626 /src/org/traccar/protocol | |
parent | af49fada37f21df9ed5ceb67504c45b714ec24d4 (diff) | |
download | trackermap-server-bec12783f99849131f80175731d00b3f7929e661.tar.gz trackermap-server-bec12783f99849131f80175731d00b3f7929e661.tar.bz2 trackermap-server-bec12783f99849131f80175731d00b3f7929e661.zip |
Always initialize MediaManager
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 8 | ||||
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolDecoder.java | 8 |
3 files changed, 6 insertions, 14 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index e1bb6f96c..4173b4d5b 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -703,11 +703,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { if (photo.writableBytes() > 0) { sendPhotoRequest(channel, pictureId); } else { - if (Context.getMediaManager() != null) { - Device device = Context.getDeviceManager().getById(deviceSession.getDeviceId()); - position.set(Position.KEY_IMAGE, - Context.getMediaManager().writeFile(device.getUniqueId(), photo, "jpg")); - } + Device device = Context.getDeviceManager().getById(deviceSession.getDeviceId()); + position.set( + Position.KEY_IMAGE, Context.getMediaManager().writeFile(device.getUniqueId(), photo, "jpg")); photos.remove(pictureId); } diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 4d42683b1..11e38194f 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -477,9 +477,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); - if (Context.getMediaManager() != null) { - position.set(Position.KEY_IMAGE, Context.getMediaManager().writeFile(imei, photo, "jpg")); - } + position.set(Position.KEY_IMAGE, Context.getMediaManager().writeFile(imei, photo, "jpg")); photo = null; return position; diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java index cc0364094..fe62874b5 100644 --- a/src/org/traccar/protocol/WatchProtocolDecoder.java +++ b/src/org/traccar/protocol/WatchProtocolDecoder.java @@ -246,9 +246,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { int timeIndex = buf.indexOf(buf.readerIndex(), buf.writerIndex(), (byte) ','); buf.readerIndex(timeIndex + 12 + 2); - if (Context.getMediaManager() != null) { - position.set(Position.KEY_IMAGE, Context.getMediaManager().writeFile(id, buf, "jpg")); - } + position.set(Position.KEY_IMAGE, Context.getMediaManager().writeFile(id, buf, "jpg")); return position; @@ -259,9 +257,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); - if (Context.getMediaManager() != null) { - position.set(Position.KEY_AUDIO, Context.getMediaManager().writeFile(id, buf, "amr")); - } + position.set(Position.KEY_AUDIO, Context.getMediaManager().writeFile(id, buf, "amr")); return position; |