diff options
Diffstat (limited to 'src/com/android/tv/dvr/DvrDataManager.java')
-rw-r--r-- | src/com/android/tv/dvr/DvrDataManager.java | 73 |
1 files changed, 54 insertions, 19 deletions
diff --git a/src/com/android/tv/dvr/DvrDataManager.java b/src/com/android/tv/dvr/DvrDataManager.java index 4f8b0525..c96104e5 100644 --- a/src/com/android/tv/dvr/DvrDataManager.java +++ b/src/com/android/tv/dvr/DvrDataManager.java @@ -20,6 +20,8 @@ import android.support.annotation.MainThread; import android.support.annotation.Nullable; import android.util.Range; +import com.android.tv.common.recording.RecordedProgram; + import java.util.List; /** @@ -32,24 +34,24 @@ public interface DvrDataManager { boolean isInitialized(); /** - * Returns recordings. + * Returns past recordings. */ - List<Recording> getRecordings(); + List<RecordedProgram> getRecordedPrograms(); /** - * Returns past recordings. + * Returns all {@link ScheduledRecording} regardless of state. */ - List<Recording> getFinishedRecordings(); + List<ScheduledRecording> getAllScheduledRecordings(); /** - * Returns started recordings. + * Returns started recordings that expired. */ - List<Recording> getStartedRecordings(); + List<ScheduledRecording> getStartedRecordings(); /** - * Returns scheduled recordings + * Returns scheduled but not started recordings that have not expired. */ - List<Recording> getScheduledRecordings(); + List<ScheduledRecording> getNonStartedScheduledRecordings(); /** * Returns season recordings. @@ -73,27 +75,60 @@ public interface DvrDataManager { * * @param period a time period in milliseconds. */ - List<Recording> getRecordingsThatOverlapWith(Range<Long> period); + List<ScheduledRecording> getRecordingsThatOverlapWith(Range<Long> period); + + /** + * Add a {@link ScheduledRecordingListener}. + */ + void addScheduledRecordingListener(ScheduledRecordingListener scheduledRecordingListener); + + /** + * Remove a {@link ScheduledRecordingListener}. + */ + void removeScheduledRecordingListener(ScheduledRecordingListener scheduledRecordingListener); + + /** + * Add a {@link RecordedProgramListener}. + */ + void addRecordedProgramListener(RecordedProgramListener listener); /** - * Add a {@link Listener}. + * Remove a {@link RecordedProgramListener}. */ - void addListener(Listener listener); + void removeRecordedProgramListener(RecordedProgramListener listener); /** - * Remove a {@link Listener}. + * Returns the scheduled recording program with the given recordingId or null if is not found. */ - void removeListener(Listener listener); + @Nullable + ScheduledRecording getScheduledRecording(long recordingId); + + + /** + * Returns the scheduled recording program with the given programId or null if is not found. + */ + @Nullable + ScheduledRecording getScheduledRecordingForProgramId(long programId); /** - * Returns the recording with the given recordingId or null if is not found + * Returns the recorded program with the given recordingId or null if is not found. */ @Nullable - Recording getRecording(long recordingId); + RecordedProgram getRecordedProgram(long recordingId); + + interface ScheduledRecordingListener { + void onScheduledRecordingAdded(ScheduledRecording scheduledRecording); + + void onScheduledRecordingRemoved(ScheduledRecording scheduledRecording); + + void onScheduledRecordingStatusChanged(ScheduledRecording scheduledRecording); + } + + interface RecordedProgramListener { + void onRecordedProgramAdded(RecordedProgram recordedProgram); + + void onRecordedProgramChanged(RecordedProgram recordedProgram); - interface Listener { - void onRecordingAdded(Recording recording); - void onRecordingRemoved(Recording recording); - void onRecordingStatusChanged(Recording recording); + void onRecordedProgramRemoved(RecordedProgram recordedProgram); } } |