HealthConnect: Queue exports in the background

This commit is contained in:
Manuel
2026-05-01 18:12:03 +03:00
committed by Dennis Guse
parent f0616fc043
commit 713e454e44
7 changed files with 422 additions and 6 deletions
@@ -168,6 +168,29 @@ public class ContentProviderUtils {
return tracks;
}
public List<Track> getTracksOrderedByStartTime(Instant startTimeInclusive) {
ArrayList<Track> tracks = new ArrayList<>();
String selection = null;
String[] selectionArgs = null;
if (startTimeInclusive != null) {
selection = TracksColumns.STARTTIME + ">=?";
selectionArgs = new String[]{Long.toString(startTimeInclusive.toEpochMilli())};
}
String sortOrder = TracksColumns.STARTTIME + " ASC, " + TracksColumns._ID + " ASC";
try (Cursor cursor = getTrackCursor(selection, selectionArgs, sortOrder)) {
if (cursor != null && cursor.moveToFirst()) {
tracks.ensureCapacity(cursor.getCount());
do {
tracks.add(createTrack(cursor));
} while (cursor.moveToNext());
}
}
return tracks;
}
public TrackListIterator searchTracks(String searchQuery) {
// Needed, because MARKER_COUNT is a virtual column and has to be explicitly requested.
final String[] PROJECTION = new String[]{