Home | History | Annotate | Download | only in data

Lines Matching refs:programs

24 import android.media.tv.TvContract.Programs;
76 // COLUMN_CHANNEL_ID, COLUMN_END_TIME_UTC_MILLIS are added to detect duplicated programs.
77 // Duplicated programs are always consecutive by the sorting order.
78 private static final String SORT_BY_TIME = Programs.COLUMN_START_TIME_UTC_MILLIS + ", "
79 + Programs.COLUMN_CHANNEL_ID + ", " + Programs.COLUMN_END_TIME_UTC_MILLIS;
152 * Set the program prefetch update wait which gives the delay to query all programs from DB
170 // to the handler. If not, another DB task can be executed before loading current programs.
175 mContentResolver.registerContentObserver(Programs.CONTENT_URI,
211 /** Returns all the current programs. */
277 * Returns the programs for the given channel which ends after the given start time.
281 * @return {@link List} with Programs. It may includes dummy program if the entry needs DB
296 // If there isn't, return the first program among programs that starts after the given time
298 private int getProgramIndexAt(List<Program> programs, long time) {
304 int index = Collections.binarySearch(programs, key);
307 if (index > 0 && isProgramPlayedAt(programs.get(index - 1), time)) {
389 // Remove previous programs which will not be shown in program guide.
396 // Keep the programs that ends earlier than current program
419 // If all the cached programs finish before mPrefetchTimeRangeStartMs, the
457 Log.d(TAG, "Starts programs prefetch. " + Utils.toTimeString(mStartTimeMs) + "-"
460 Uri uri = Programs.CONTENT_URI.buildUpon()
490 ArrayList<Program> programs = programMap.get(program.getChannelId());
491 if (programs == null) {
492 programs = new ArrayList<>();
493 programMap.put(program.getChannelId(), programs);
495 programs.add(program);
497 Log.w(TAG, "Found " + duplicateCount + " duplicate programs");
511 Log.d(TAG, "Ends programs prefetch for " + programMap.size() + " channels");
517 protected void onPostExecute(Map<Long, ArrayList<Program>> programs) {
525 mChannelIdProgramCache = programs;
550 super(contentResolver, Programs.CONTENT_URI.buildUpon()
558 final List<Program> programs = new ArrayList<>();
564 return programs;
573 programs.add(program);
576 Log.w(TAG, "Found " + duplicateCount + " duplicate programs");
579 return programs;
583 protected void onPostExecute(List<Program> programs) {
586 if (programs != null) {
588 for (Program program : programs) {
712 // Fetch the programs immediately to re-create the cache.