• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.tv.data.epg;
18 
19 import android.support.annotation.WorkerThread;
20 
21 import com.android.tv.data.Channel;
22 import com.android.tv.data.Program;
23 
24 import java.util.List;
25 
26 /**
27  * An interface used to retrieve the EPG data. This class should be used in worker thread.
28  */
29 @WorkerThread
30 public interface EpgReader {
31     /**
32      * Checks if the reader is available.
33      */
isAvailable()34     boolean isAvailable();
35 
36     /**
37      * Returns the timestamp of the current EPG.
38      * The format should be YYYYMMDDHHmmSS as a long value. ex) 20160308141500
39      */
getEpgTimestamp()40     long getEpgTimestamp();
41 
42     /**
43      * Returns the channels list.
44      */
getChannels()45     List<Channel> getChannels();
46 
47     /**
48      * Returns the programs for the given channel. The result is sorted by the start time.
49      * Note that the {@code Program} doesn't have valid program ID because it's not retrieved from
50      * TvProvider.
51      */
getPrograms(long channelId)52     List<Program> getPrograms(long channelId);
53 }
54