diff options
author | Abyss777 <abyss@fox5.ru> | 2017-03-20 15:04:54 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-03-20 15:04:54 +0500 |
commit | 1455ad6ce058f02d812e23fb275265f105272f4d (patch) | |
tree | 416ebf1a9db496e11632926d0c36abf2b2bea963 /src/org/traccar/database/DeviceManager.java | |
parent | 99e16edfd8b29d5ef1b751eefcf87a14df35cb9b (diff) | |
download | trackermap-server-1455ad6ce058f02d812e23fb275265f105272f4d.tar.gz trackermap-server-1455ad6ce058f02d812e23fb275265f105272f4d.tar.bz2 trackermap-server-1455ad6ce058f02d812e23fb275265f105272f4d.zip |
Move handleTextMessage function to separate handler.
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r-- | src/org/traccar/database/DeviceManager.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index ca686b95c..f70b9b1a2 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -34,7 +34,6 @@ import org.traccar.model.Command; import org.traccar.model.CommandType; import org.traccar.model.Device; import org.traccar.model.DeviceTotalDistance; -import org.traccar.model.Event; import org.traccar.model.Group; import org.traccar.model.Position; import org.traccar.model.Server; @@ -139,9 +138,9 @@ public class DeviceManager implements IdentityManager { devicesById.remove(cachedDeviceId); } } - for (String cachedDeviceUniqId : devicesByUniqueId.keySet()) { - if (!databaseDevicesUniqueIds.contains(cachedDeviceUniqId)) { - devicesByUniqueId.remove(cachedDeviceUniqId); + for (String cachedDeviceUniqueId : devicesByUniqueId.keySet()) { + if (!databaseDevicesUniqueIds.contains(cachedDeviceUniqueId)) { + devicesByUniqueId.remove(cachedDeviceUniqueId); } } for (String cachedDevicePhone : devicesByPhone.keySet()) { @@ -149,9 +148,6 @@ public class DeviceManager implements IdentityManager { devicesByPhone.remove(cachedDevicePhone); } } - databaseDevicesIds.clear(); - databaseDevicesUniqueIds.clear(); - databaseDevicesPhones.clear(); } } @@ -507,13 +503,4 @@ public class DeviceManager implements IdentityManager { } return result; } - - public void handleTextMessage(String phone, String message) { - Device device = devicesByPhone.get(phone); - if (device != null && Context.getNotificationManager() != null) { - Event event = new Event(Event.TYPE_TEXT_MESSAGE, device.getId()); - event.set("message", message); - Context.getNotificationManager().updateEvent(event, null); - } - } } |