This commit is contained in:
cyBerta
2019-04-22 16:07:25 +02:00
committed by B. Petersen
parent 6912196961
commit 07caaa9f37
3 changed files with 4 additions and 11 deletions
@@ -67,10 +67,8 @@ public class DataCollectionTask extends AsyncTask<Void, Void, Void> {
featureCollections,
lastPositions,
boundingBuilder);
int markerCounter = 0;
for (int contactId : contactIds) {
markerCounter = markerCounter + dataCollector.updateSource(chatId,
dataCollector.updateSource(chatId,
contactId,
System.currentTimeMillis() - TIME_FRAME,
TIMESTAMP_NOW);
@@ -13,7 +13,6 @@ import com.mapbox.mapboxsdk.geometry.LatLngBounds;
import org.thoughtcrime.securesms.map.model.MapSource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.concurrent.ConcurrentHashMap;
@@ -53,14 +52,14 @@ public class DataCollector {
}
public int updateSource(int chatId,
public void updateSource(int chatId,
int contactId,
long startTimestamp,
long endTimestamp) {
DcArray locations = dcContext.getLocations(chatId, contactId, startTimestamp, endTimestamp);
int count = locations.getCnt();
if (count == 0) {
return 0;
return;
}
MapSource contactMapMetadata = contactMapSources.get(contactId);
@@ -70,7 +69,7 @@ public class DataCollector {
LinkedList<Feature> sortedPointFeatures = featureCollections.get(contactMapMetadata.getMarkerFeatureCollection());
if (sortedPointFeatures != null && sortedPointFeatures.size() == count) {
return -1;
return;
} else {
sortedPointFeatures = new LinkedList<>();
}
@@ -121,8 +120,6 @@ public class DataCollector {
featureCollections.put(contactMapMetadata.getMarkerFeatureCollection(), sortedPointFeatures);
featureCollections.put(contactMapMetadata.getLineFeatureCollection(), sortedLineFeatures);
return count;
}
private MapSource addContactMapSource(ConcurrentHashMap<Integer, MapSource> contactMapSources, int contactId) {
@@ -13,7 +13,6 @@ import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.b44t.messenger.DcContact;
import com.b44t.messenger.DcEventCenter;
import com.mapbox.geojson.Feature;
import com.mapbox.geojson.FeatureCollection;
@@ -34,7 +33,6 @@ import org.thoughtcrime.securesms.map.model.MapSource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;