Cleanup: removed unnecessary interface from ContentProviderUtils.

This commit is contained in:
Dennis Guse
2026-02-26 20:35:55 +01:00
parent 8d3e953220
commit d49e7749f3
2 changed files with 2 additions and 8 deletions
@@ -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<>();