mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-09-30 16:52:21 +02:00
Cleanup: removed unnecessary interface from ContentProviderUtils.
This commit is contained in:
@@ -72,11 +72,6 @@ public class ContentProviderUtils {
|
||||
|
||||
private final ContentResolver contentResolver;
|
||||
|
||||
//TODO Check if this can be used in more than one place. If not remove.
|
||||
public interface ContentProviderSelectionInterface {
|
||||
SelectionData buildSelection();
|
||||
}
|
||||
|
||||
public ContentProviderUtils(Context context) {
|
||||
contentResolver = context.getContentResolver();
|
||||
}
|
||||
@@ -746,7 +741,7 @@ public class ContentProviderUtils {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<AggregatedStatistic> getAggregatedStatisticsForTracks(ContentProviderSelectionInterface selection) {
|
||||
public List<AggregatedStatistic> getAggregatedStatisticsForTracks(TrackSelection selection) {
|
||||
SelectionData data = selection.buildSelection();
|
||||
try (Cursor cursor = contentResolver.query(TracksColumns.CONTENT_URI_AGGREGATED_STATISTICS, null, data.selection(), data.getSelectionArgs(), null)) {
|
||||
ArrayList<AggregatedStatistic> aggregatedStatistics = new ArrayList<>(cursor.getCount());
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
import de.dennisguse.opentracks.data.models.Track;
|
||||
import de.dennisguse.opentracks.data.tables.TracksColumns;
|
||||
|
||||
public class TrackSelection implements ContentProviderUtils.ContentProviderSelectionInterface {
|
||||
public class TrackSelection {
|
||||
private final List<Track.Id> trackIds = new ArrayList<>();
|
||||
private final List<String> categories = new ArrayList<>();
|
||||
private Instant from;
|
||||
@@ -40,7 +40,6 @@ public class TrackSelection implements ContentProviderUtils.ContentProviderSelec
|
||||
return trackIds.isEmpty() && categories.isEmpty() && from == null && to == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContentProviderUtils.SelectionData buildSelection() {
|
||||
String selection = "";
|
||||
List<String> selectionArgs = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user