diff options
Diffstat (limited to 'src/com/android/tv/data/epg/EpgReader.java')
-rw-r--r-- | src/com/android/tv/data/epg/EpgReader.java | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/com/android/tv/data/epg/EpgReader.java b/src/com/android/tv/data/epg/EpgReader.java index 4f3b6f52..95cd933e 100644 --- a/src/com/android/tv/data/epg/EpgReader.java +++ b/src/com/android/tv/data/epg/EpgReader.java @@ -22,9 +22,10 @@ import android.support.annotation.WorkerThread; import com.android.tv.data.Channel; import com.android.tv.data.Lineup; import com.android.tv.data.Program; -import com.android.tv.dvr.SeriesInfo; +import com.android.tv.dvr.data.SeriesInfo; import java.util.List; +import java.util.Map; /** * An interface used to retrieve the EPG data. This class should be used in worker thread. @@ -43,21 +44,37 @@ public interface EpgReader { long getEpgTimestamp(); /** - * Returns the channels list. + * Returns the lineups list. + */ + List<Lineup> getLineups(@NonNull String postalCode); + + /** + * Returns the list of channel numbers (unsorted) for the given lineup. The result is used to + * choose the most appropriate lineup among others by comparing the channel numbers of the + * existing channels on the device. + */ + List<String> getChannelNumbers(@NonNull String lineupId); + + /** + * Returns the list of channels for the given lineup. The returned channels should map into the + * existing channels on the device. This method is usually called after selecting the lineup. */ List<Channel> getChannels(@NonNull String lineupId); /** - * Returns the lineups list. + * Returns the programs for the given channel. Must call {@link #getChannels(String)} + * beforehand. Note that the {@code Program} doesn't have valid program ID because it's not + * retrieved from TvProvider. */ - List<Lineup> getLineups(@NonNull String postalCode); + List<Program> getPrograms(long channelId); /** - * Returns the programs for the given channel. The result is sorted by the start time. + * Returns the programs for the given channels. * Note that the {@code Program} doesn't have valid program ID because it's not retrieved from * TvProvider. + * This method is only used to get programs for a short duration typically. */ - List<Program> getPrograms(long channelId); + Map<Long, List<Program>> getPrograms(List<Long> channelIds, long duration); /** * Returns the series information for the given series ID. |