TrackRecordingService: avoid race condition while stopping a recording.

This commit is contained in:
Dennis Guse
2021-05-18 16:43:57 +02:00
parent ae001c73dd
commit e71ab28701
2 changed files with 19 additions and 14 deletions
@@ -205,10 +205,7 @@ public class ContentProviderUtils {
return tracks;
}
public Track getTrack(Track.Id trackId) {
if (trackId == null) {
return null;
}
public Track getTrack(@NonNull Track.Id trackId) {
try (Cursor cursor = getTrackCursor(TracksColumns._ID + "=?", new String[]{Long.toString(trackId.getId())}, null)) {
if (cursor != null && cursor.moveToNext()) {
return createTrack(cursor);