/packages/apps/TV/tests/unit/src/com/android/tv/dvr/ |
DvrDataManagerInMemoryImpl.java | 30 import com.android.tv.dvr.data.ScheduledRecording; 31 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 47 private final Map<Long, ScheduledRecording> mScheduledRecordings = new HashMap<>(); 70 private List<ScheduledRecording> getScheduledRecordingsPrograms() { 80 public List<ScheduledRecording> getAllScheduledRecordings() { 102 List<ScheduledRecording> temp = getNonStartedScheduledRecordings(); 103 Collections.sort(temp, ScheduledRecording.START_TIME_COMPARATOR); 104 for (ScheduledRecording r : temp) { 113 public List<ScheduledRecording> getScheduledRecordings(Range<Long> period, 115 List<ScheduledRecording> temp = getScheduledRecordingsPrograms() [all...] |
ScheduledRecordingTest.java | 31 import com.android.tv.dvr.data.ScheduledRecording; 50 ScheduledRecording r = createTestRecordingWithIdAndPeriod(1, INPUT_ID, CHANNEL_ID, 69 ScheduledRecording actual = ScheduledRecording.builder(INPUT_ID, p) 71 assertEquals("type", ScheduledRecording.TYPE_PROGRAM, actual.getType()); 76 ScheduledRecording actual = createTestRecordingWithIdAndPeriod(1, INPUT_ID, CHANNEL_ID, 78 assertEquals("type", ScheduledRecording.TYPE_TIMED, actual.getType()); 83 ScheduledRecording expected = createTestRecordingWithIdAndPeriod(1, INPUT_ID, CHANNEL_ID, 85 ScheduledRecording actual = ScheduledRecording.buildFrom(expected).build() [all...] |
DvrScheduleManagerTest.java | 29 import com.android.tv.dvr.data.ScheduledRecording; 47 List<ScheduledRecording> schedules = new ArrayList<>(); 55 List<ScheduledRecording> schedules = new ArrayList<>(); 82 List<ScheduledRecording> schedules = new ArrayList<>(); 97 List<ScheduledRecording> schedules = new ArrayList<>(); 99 ScheduledRecording r1 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod( 104 ScheduledRecording r2 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod( 111 ScheduledRecording r3 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod( 118 ScheduledRecording r4 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod( 127 ScheduledRecording r5 = RecordingTestUtils.createTestRecordingWithPriorityAndPeriod [all...] |
BaseDvrDataManagerTest.java | 29 import com.android.tv.dvr.data.ScheduledRecording; 65 ScheduledRecording recording = mDvrDataManager 67 List<ScheduledRecording> result = mDvrDataManager.getNonStartedScheduledRecordings(); 75 List<ScheduledRecording> result = mDvrDataManager.getNonStartedScheduledRecordings(); 80 private ScheduledRecording createNewScheduledRecordingStartingNow() { 81 return ScheduledRecording.buildFrom(RecordingTestUtils 83 ScheduledRecording.ID_NOT_SET, 87 .setState(ScheduledRecording.STATE_RECORDING_NOT_STARTED)
|
/packages/apps/TV/tests/common/src/com/android/tv/testing/dvr/ |
RecordingTestUtils.java | 19 import com.android.tv.dvr.data.ScheduledRecording; 24 * Static utils for using {@link ScheduledRecording} in tests. 30 public static ScheduledRecording createTestRecordingWithIdAndPeriod(long id, String inputId, 32 return ScheduledRecording.builder(inputId, channelId, startTime, endTime) 38 public static ScheduledRecording createTestRecordingWithPeriod(String inputId, 40 return createTestRecordingWithIdAndPeriod(ScheduledRecording.ID_NOT_SET, inputId, channelId, 44 public static ScheduledRecording createTestRecordingWithPriorityAndPeriod(long channelId, 46 return ScheduledRecording.builder(INPUT_ID, CHANNEL_ID, startTime, endTime) 52 public static ScheduledRecording createTestRecordingWithIdAndPriorityAndPeriod(long id, 54 return ScheduledRecording.builder(INPUT_ID, CHANNEL_ID, startTime, endTime [all...] |
/packages/apps/TV/src/com/android/tv/dvr/ |
BaseDvrDataManager.java | 30 import com.android.tv.dvr.data.ScheduledRecording; 31 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 62 private final HashMap<Long, ScheduledRecording> mDeletedScheduleMap = new HashMap<>(); 213 protected final void notifyScheduledRecordingAdded(ScheduledRecording... scheduledRecording) { 215 if (DEBUG) Log.d(TAG, "notify " + l + " added " + Arrays.asList(scheduledRecording)); 216 l.onScheduledRecordingAdded(scheduledRecording); 224 protected final void notifyScheduledRecordingRemoved(ScheduledRecording... scheduledRecording) { 226 if (DEBUG) Log.d(TAG, "notify " + l + " removed " + Arrays.asList(scheduledRecording)); [all...] |
DvrDataManagerImpl.java | 47 import com.android.tv.dvr.data.ScheduledRecording; 48 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 88 private final HashMap<Long, ScheduledRecording> mScheduledRecordings = new HashMap<>(); 91 private final HashMap<Long, ScheduledRecording> mProgramId2ScheduledRecordings = 95 private final HashMap<Long, ScheduledRecording> mScheduledRecordingsForRemovedInput = 217 protected void onCancelled(List<ScheduledRecording> scheduledRecordings) { 223 protected void onPostExecute(List<ScheduledRecording> result) { 227 List<ScheduledRecording> toUpdate = new ArrayList<>(); 228 List<ScheduledRecording> toDelete = new ArrayList<>(); 229 for (ScheduledRecording r : result) [all...] |
WritableDvrDataManager.java | 21 import com.android.tv.dvr.data.ScheduledRecording; 22 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 36 void addScheduledRecording(ScheduledRecording... scheduledRecordings); 46 void removeScheduledRecording(ScheduledRecording... scheduledRecordings); 52 void removeScheduledRecording(boolean forceRemove, ScheduledRecording... scheduledRecordings); 62 void updateScheduledRecording(ScheduledRecording... scheduledRecordings); 72 void changeState(ScheduledRecording scheduledRecording, @RecordingState int newState);
|
DvrScheduleManager.java | 39 import com.android.tv.dvr.data.ScheduledRecording; 72 private static final Comparator<ScheduledRecording> RESULT_COMPARATOR = 74 ScheduledRecording.PRIORITY_COMPARATOR.reversed(), 75 ScheduledRecording.START_TIME_COMPARATOR, 76 ScheduledRecording.ID_COMPARATOR.reversed()); 80 private static final Comparator<ScheduledRecording> CANDIDATE_COMPARATOR = 82 ScheduledRecording.PRIORITY_COMPARATOR, 83 ScheduledRecording.END_TIME_COMPARATOR, 84 ScheduledRecording.ID_COMPARATOR); 90 private final Map<String, List<ScheduledRecording>> mInputScheduleMap = new HashMap<>() [all...] |
DvrDataManager.java | 25 import com.android.tv.dvr.data.ScheduledRecording; 26 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 62 * Returns all {@link ScheduledRecording} regardless of state. 66 List<ScheduledRecording> getAllScheduledRecordings(); 69 * Returns all available {@link ScheduledRecording}, it contains started and non started 72 List<ScheduledRecording> getAvailableScheduledRecordings(); 77 List<ScheduledRecording> getStartedRecordings(); 82 List<ScheduledRecording> getNonStartedScheduledRecordings(); 113 List<ScheduledRecording> getScheduledRecordings(Range<Long> period, @RecordingState int state); 118 List<ScheduledRecording> getScheduledRecordings(long seriesRecordingId) [all...] |
DvrManager.java | 50 import com.android.tv.dvr.data.ScheduledRecording; 159 public ScheduledRecording addSchedule(Program program) { 173 public ScheduledRecording addScheduleWithHighestPriority(Program program) { 185 private ScheduledRecording addSchedule(Program program, long priority) { 191 ScheduledRecording schedule; 222 public void addSchedule(ScheduledRecording schedule) { 229 mDataManager.addScheduledRecording(ScheduledRecording 275 List<ScheduledRecording> toAdd = new ArrayList<>(); 282 toAdd.add(ScheduledRecording.builder(recordedProgram) 288 mDataManager.addScheduledRecording(ScheduledRecording.toArray(toAdd)) [all...] |
/packages/apps/TV/src/com/android/tv/dvr/recorder/ |
InputTaskScheduler.java | 35 import com.android.tv.dvr.data.ScheduledRecording; 72 public static Comparator<ScheduledRecording> getRecordingOrderComparator() { 73 return ScheduledRecording.START_TIME_THEN_PRIORITY_THEN_ID_COMPARATOR; 84 HandlerWrapper(Looper looper, ScheduledRecording scheduledRecording, 87 mId = scheduledRecording.getId(); 117 private final Map<Long, ScheduledRecording> mWaitingSchedules = new ArrayMap<>(); 148 public RecordingTask createRecordingTask(ScheduledRecording schedule, Channel channel, 159 * Adds a {@link ScheduledRecording}. 161 public void addSchedule(ScheduledRecording schedule) [all...] |
ScheduledProgramReaper.java | 23 import com.android.tv.dvr.data.ScheduledRecording; 32 * Deletes {@link ScheduledRecording} older than {@value @DAYS} days. 50 List<ScheduledRecording> toRemove = new ArrayList<>(); 51 for (ScheduledRecording r : mDvrDataManager.getAllScheduledRecordings()) { 57 || r.getState() != ScheduledRecording.STATE_RECORDING_FINISHED)) { 61 for (ScheduledRecording r : mDvrDataManager.getDeletedSchedules()) { 67 mDvrDataManager.removeScheduledRecording(ScheduledRecording.toArray(toRemove));
|
/packages/apps/TV/src/com/android/tv/dvr/ui/list/ |
EpisodicProgramRow.java | 22 import com.android.tv.dvr.data.ScheduledRecording; 23 import com.android.tv.dvr.data.ScheduledRecording.Builder; 33 public EpisodicProgramRow(String inputId, Program program, ScheduledRecording recording, 64 return ScheduledRecording.builder(mInputId, mProgram); 78 public boolean matchSchedule(ScheduledRecording schedule) { 79 return schedule.getType() == ScheduledRecording.TYPE_PROGRAM
|
ScheduleRow.java | 23 import com.android.tv.dvr.data.ScheduledRecording; 31 @Nullable private ScheduledRecording mSchedule; 35 public ScheduleRow(@Nullable ScheduledRecording recording, SchedulesHeaderRow headerRow) { 51 public ScheduledRecording getSchedule() { 88 public void setSchedule(@Nullable ScheduledRecording schedule) { 133 && mSchedule.getState() == ScheduledRecording.STATE_RECORDING_NOT_STARTED; 141 && mSchedule.getState() == ScheduledRecording.STATE_RECORDING_IN_PROGRESS; 149 && mSchedule.getState() == ScheduledRecording.STATE_RECORDING_CANCELED; 154 && (mSchedule.getState() == ScheduledRecording.STATE_RECORDING_FAILED 155 || mSchedule.getState() == ScheduledRecording.STATE_RECORDING_CLIPPE [all...] |
BaseDvrSchedulesFragment.java | 32 import com.android.tv.dvr.data.ScheduledRecording; 145 public void onScheduledRecordingAdded(ScheduledRecording... scheduledRecordings) { 147 for (ScheduledRecording recording : scheduledRecordings) { 154 public void onScheduledRecordingRemoved(ScheduledRecording... scheduledRecordings) { 156 for (ScheduledRecording recording : scheduledRecordings) { 163 public void onScheduledRecordingStatusChanged(ScheduledRecording... scheduledRecordings) { 165 for (ScheduledRecording recording : scheduledRecordings) { 172 public void onConflictStateChange(boolean conflict, ScheduledRecording... schedules) { 174 for (ScheduledRecording recording : schedules) {
|
DvrSchedulesFragment.java | 23 import com.android.tv.dvr.data.ScheduledRecording; 54 public void onScheduledRecordingAdded(ScheduledRecording... scheduledRecordings) { 62 public void onScheduledRecordingRemoved(ScheduledRecording... scheduledRecordings) { 72 ScheduledRecording recording = null;
|
ScheduleRowAdapter.java | 34 import com.android.tv.dvr.data.ScheduledRecording; 88 List<ScheduledRecording> recordingList = TvApplication.getSingletons(mContext) 93 ScheduledRecording.START_TIME_THEN_PRIORITY_THEN_ID_COMPARATOR); 96 ArrayList<ScheduledRecording> section = new ArrayList<>(); 106 for(ScheduledRecording recording : section){ 146 * Gets which {@link ScheduleRow} the {@link ScheduledRecording} belongs to. 148 public ScheduleRow findRowByScheduledRecording(ScheduledRecording recording) { 163 private ScheduleRow findRowWithStartRequest(ScheduledRecording schedule) { 178 private void addScheduleRow(ScheduledRecording recording) { 187 if (ScheduledRecording.START_TIME_THEN_PRIORITY_THEN_ID_COMPARATOR.compare [all...] |
/packages/apps/TV/src/com/android/tv/dvr/ui/browse/ |
RecordingDetailsFragment.java | 23 import com.android.tv.dvr.data.ScheduledRecording; 29 private ScheduledRecording mRecording; 46 * Returns {@link ScheduledRecording} for the current fragment. 48 public ScheduledRecording getRecording() {
|
ScheduledRecordingPresenter.java | 25 import com.android.tv.dvr.data.ScheduledRecording; 31 * Presents a {@link ScheduledRecording} in the {@link DvrBrowseFragment}. 33 class ScheduledRecordingPresenter extends DvrItemPresenter<ScheduledRecording> { 41 private ScheduledRecording mScheduledRecording; 56 protected void onBound(ScheduledRecording recording) { 75 if (recordingState == ScheduledRecording.STATE_RECORDING_IN_PROGRESS) { 79 } else if (recordingState == ScheduledRecording.STATE_RECORDING_FINISHED) { 110 ScheduledRecording recording) { 122 private String generateMajorContent(ScheduledRecording recording) {
|
DetailsContent.java | 28 import com.android.tv.dvr.data.ScheduledRecording; 76 ScheduledRecording scheduledRecording) { 78 .getChannel(scheduledRecording.getChannelId()); 79 String description = !TextUtils.isEmpty(scheduledRecording.getProgramDescription()) ? 80 scheduledRecording.getProgramDescription() 81 : scheduledRecording.getProgramLongDescription(); 86 .setChannelId(scheduledRecording.getChannelId()) 87 .setProgramTitle(scheduledRecording.getProgramTitle()) 88 .setSeasonNumber(scheduledRecording.getSeasonNumber() [all...] |
/packages/apps/TV/tests/unit/src/com/android/tv/dvr/recorder/ |
ScheduledProgramReaperTest.java | 31 import com.android.tv.dvr.data.ScheduledRecording; 82 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); 92 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); 103 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); 115 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); 129 private ScheduledRecording addNewScheduledRecordingForTomorrow() { 131 ScheduledRecording recording = RecordingTestUtils.createTestRecordingWithPeriod(INPUT_ID, 134 ScheduledRecording.buildFrom(recording) 135 .setState(ScheduledRecording.STATE_RECORDING_FINISHED).build());
|
/packages/apps/TV/src/com/android/tv/dialog/ |
DvrHistoryDialogFragment.java | 40 import com.android.tv.dvr.data.ScheduledRecording; 41 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 56 private final List<ScheduledRecording> mSchedules = new ArrayList<>(); 63 for (ScheduledRecording schedule : dataManager.getAllScheduledRecordings()) { 68 mSchedules.sort(ScheduledRecording.START_TIME_COMPARATOR.reversed()); 70 ArrayAdapter adapter = new ArrayAdapter<ScheduledRecording>(getContext(), 71 R.layout.list_item_dvr_history, ScheduledRecording.toArray(mSchedules)) { 76 ScheduledRecording schedule = mSchedules.get(position); 96 case ScheduledRecording.STATE_RECORDING_CLIPPED: 98 case ScheduledRecording.STATE_RECORDING_FAILED [all...] |
/packages/apps/TV/src/com/android/tv/dvr/provider/ |
AsyncDvrDbTask.java | 24 import com.android.tv.dvr.data.ScheduledRecording; 84 extends AsyncDvrDbTask<ScheduledRecording, Void, Void> { 90 protected final Void doInDvrBackground(ScheduledRecording... params) { 100 extends AsyncDvrDbTask<ScheduledRecording, Void, Void> { 106 protected final Void doInDvrBackground(ScheduledRecording... params) { 116 extends AsyncDvrDbTask<ScheduledRecording, Void, Void> { 122 protected final Void doInDvrBackground(ScheduledRecording... params) { 129 * Returns all {@link ScheduledRecording}s. 132 extends AsyncDvrDbTask<Void, Void, List<ScheduledRecording>> { 139 protected final List<ScheduledRecording> doInDvrBackground(Void... params) [all...] |
DvrDbSync.java | 39 import com.android.tv.dvr.data.ScheduledRecording; 114 public void onScheduledRecordingAdded(ScheduledRecording... schedules) { 115 for (ScheduledRecording schedule : schedules) { 122 public void onScheduledRecordingRemoved(ScheduledRecording... schedules) { 123 for (ScheduledRecording schedule : schedules) { 129 public void onScheduledRecordingStatusChanged(ScheduledRecording... schedules) { 130 for (ScheduledRecording schedule : schedules) { 197 List<ScheduledRecording> schedulesToRemove = new ArrayList<>(); 198 for (ScheduledRecording r : mDataManager.getAvailableScheduledRecordings()) { 206 ScheduledRecording.toArray(schedulesToRemove)) [all...] |