diff options
Diffstat (limited to 'src/com/android/tv/data/epg/EpgReader.java')
-rw-r--r-- | src/com/android/tv/data/epg/EpgReader.java | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/src/com/android/tv/data/epg/EpgReader.java b/src/com/android/tv/data/epg/EpgReader.java index 4f3b6f52..c5aeca27 100644 --- a/src/com/android/tv/data/epg/EpgReader.java +++ b/src/com/android/tv/data/epg/EpgReader.java @@ -16,15 +16,17 @@ package com.android.tv.data.epg; +import android.support.annotation.AnyThread; import android.support.annotation.NonNull; 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. @@ -42,25 +44,48 @@ public interface EpgReader { */ long getEpgTimestamp(); + /** Sets the region code. */ + void setRegionCode(String regionCode); + + /** Returns the lineups list. */ + List<Lineup> getLineups(@NonNull String postalCode); + /** - * Returns the channels list. + * 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); + /** Pre-loads and caches channels for a given lineup. */ + void preloadChannels(@NonNull String lineupId); + /** - * Returns the lineups list. + * Clears cached channels for a given lineup. */ - List<Lineup> getLineups(@NonNull String postalCode); + @AnyThread + void clearCachedChannels(@NonNull String lineupId); /** - * Returns the programs for the given channel. The result is sorted by the start time. - * Note that the {@code Program} doesn't have valid program ID because it's not retrieved from - * TvProvider. + * 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<Program> getPrograms(long channelId); /** - * Returns the series information for the given series ID. + * 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. */ - SeriesInfo getSeriesInfo(String seriesId); -} + Map<Long, List<Program>> getPrograms(@NonNull List<Long> channelIds, long duration); + + /** Returns the series information for the given series ID. */ + SeriesInfo getSeriesInfo(@NonNull String seriesId); +}
\ No newline at end of file |