/packages/apps/TV/tests/unit/src/com/android/tv/dvr/ |
D | ScheduledRecordingTest.java | 45 ScheduledRecording r = createTestRecordingWithIdAndPeriod(1, CHANNEL_ID, 10L, 20L); in testIsOverLapping() 62 ScheduledRecording actual = ScheduledRecording.builder(p).setChannelId(c.getId()).build(); in testBuildProgram() 63 assertEquals("type", ScheduledRecording.TYPE_PROGRAM, actual.getType()); in testBuildProgram() 67 ScheduledRecording actual = createTestRecordingWithIdAndPeriod(1, CHANNEL_ID, 10L, 20L); in testBuildTime() 68 assertEquals("type", ScheduledRecording.TYPE_TIMED, actual.getType()); in testBuildTime() 72 ScheduledRecording expected = createTestRecordingWithIdAndPeriod(1, CHANNEL_ID, 10L, 20L); in testBuildFrom() 73 ScheduledRecording actual = ScheduledRecording.buildFrom(expected).build(); in testBuildFrom() 78 ScheduledRecording a = normalizePriority( in testBuild_priority() 80 ScheduledRecording b = normalizePriority( in testBuild_priority() 82 ScheduledRecording c = normalizePriority( in testBuild_priority() [all …]
|
D | BaseDvrDataManagerTest.java | 48 ScheduledRecording recording = mDvrDataManager in testGetNonStartedScheduledRecordings() 50 List<ScheduledRecording> result = mDvrDataManager.getNonStartedScheduledRecordings(); in testGetNonStartedScheduledRecordings() 57 List<ScheduledRecording> result = mDvrDataManager.getNonStartedScheduledRecordings(); in testGetNonStartedScheduledRecordings_past() 62 private ScheduledRecording createNewScheduledRecordingStartingNow() { in createNewScheduledRecordingStartingNow() 63 return ScheduledRecording.buildFrom(RecordingTestUtils in createNewScheduledRecordingStartingNow() 69 .setState(ScheduledRecording.STATE_RECORDING_NOT_STARTED) in createNewScheduledRecordingStartingNow()
|
D | ScheduledProgramReaperTest.java | 38 private ScheduledRecording mScheduledRecordingDay1; 57 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); in testRun_oneRecordingsTomorrow() 66 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); in testRun_oneRecordingsStarted() 76 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); in testRun_oneRecordingsFinished() 87 ScheduledRecording recording = addNewScheduledRecordingForTomorrow(); in testRun_oneRecordingsExpired() 102 private ScheduledRecording addNewScheduledRecordingForTomorrow() { in addNewScheduledRecordingForTomorrow()
|
D | RecordingTaskTest.java | 82 ScheduledRecording r = createRecording(channel); in testHandle_init() 110 ScheduledRecording r = createRecording(channel); in testHandle_init_cannotAcquireSession() 121 ScheduledRecording updatedScheduledRecording = mDataManager in testHandle_init_cannotAcquireSession() 123 assertEquals("status", ScheduledRecording.STATE_RECORDING_FAILED, in testHandle_init_cannotAcquireSession() 129 ScheduledRecording r = createRecording(channel); in testOnConnected() 138 private ScheduledRecording createRecording(Channel c) { in createRecording() 144 private RecordingTask createRecordingTask(ScheduledRecording r, Channel channel) { in createRecordingTask() 145 Program p = r.getProgramId() == ScheduledRecording.ID_NOT_SET ? null in createRecordingTask()
|
D | DvrDataManagerImplTest.java | 37 List<ScheduledRecording> scheduledRecordings = new ArrayList<>(); in testGetNextScheduledStartTimeAfter() 65 …private void assertNextStartTime(List<ScheduledRecording> scheduledRecordings, long startTime, lon… in assertNextStartTime()
|
/packages/apps/TV/src/com/android/tv/dvr/ |
D | DvrDataManagerInMemoryImpl.java | 45 private final Map<Long, ScheduledRecording> mScheduledRecordings = new HashMap<>(); 58 private List<ScheduledRecording> getScheduledRecordingsPrograms() { in getScheduledRecordingsPrograms() 68 public List<ScheduledRecording> getAllScheduledRecordings() { in getAllScheduledRecordings() 79 List<ScheduledRecording> temp = getNonStartedScheduledRecordings(); in getNextScheduledStartTimeAfter() 80 Collections.sort(temp, ScheduledRecording.START_TIME_COMPARATOR); in getNextScheduledStartTimeAfter() 81 for (ScheduledRecording r : temp) { in getNextScheduledStartTimeAfter() 90 public List<ScheduledRecording> getRecordingsThatOverlapWith(Range<Long> period) { in getRecordingsThatOverlapWith() 91 List<ScheduledRecording> temp = getScheduledRecordingsPrograms(); in getRecordingsThatOverlapWith() 92 List<ScheduledRecording> result = new ArrayList<>(); in getRecordingsThatOverlapWith() 93 for (ScheduledRecording r : temp) { in getRecordingsThatOverlapWith() [all …]
|
D | DvrDataManagerImpl.java | 40 import com.android.tv.dvr.ScheduledRecording.RecordingState; 62 private final HashMap<Long, ScheduledRecording> mScheduledRecordings = new HashMap<>(); 63 private final HashMap<Long, ScheduledRecording> mProgramId2ScheduledRecordings = 123 protected void onCancelled(List<ScheduledRecording> scheduledRecordings) { in start() 128 protected void onPostExecute(List<ScheduledRecording> result) { in start() 131 for (ScheduledRecording r : result) { in start() 161 private List<ScheduledRecording> getScheduledRecordingsPrograms() { in getScheduledRecordingsPrograms() 165 ArrayList<ScheduledRecording> list = new ArrayList<>(mScheduledRecordings.size()); in getScheduledRecordingsPrograms() 167 Collections.sort(list, ScheduledRecording.START_TIME_COMPARATOR); in getScheduledRecordingsPrograms() 180 public List<ScheduledRecording> getAllScheduledRecordings() { in getAllScheduledRecordings() [all …]
|
D | ScheduledRecording.java | 39 public final class ScheduledRecording { class 47 …public static final Comparator<ScheduledRecording> START_TIME_COMPARATOR = new Comparator<Schedule… 49 public int compare(ScheduledRecording lhs, ScheduledRecording rhs) { 54 …public static final Comparator<ScheduledRecording> PRIORITY_COMPARATOR = new Comparator<ScheduledR… 56 public int compare(ScheduledRecording lhs, ScheduledRecording rhs) { 65 public static final Comparator<ScheduledRecording> START_TIME_THEN_PRIORITY_COMPARATOR 66 = new Comparator<ScheduledRecording>() { 68 public int compare(ScheduledRecording lhs, ScheduledRecording rhs) { 149 public ScheduledRecording build() { in build() 150 return new ScheduledRecording(mId, mPriority, mChannelId, mProgramId, mType, mStartTime, in build() [all …]
|
D | BaseDvrDataManager.java | 110 protected final void notifyScheduledRecordingAdded(ScheduledRecording scheduledRecording) { in notifyScheduledRecordingAdded() 121 protected final void notifyScheduledRecordingRemoved(ScheduledRecording scheduledRecording) { in notifyScheduledRecordingRemoved() 136 ScheduledRecording scheduledRecording) { in notifyScheduledRecordingStatusChanged() 147 private List<ScheduledRecording> filterEndTimeIsPast(List<ScheduledRecording> originals) { in filterEndTimeIsPast() 148 List<ScheduledRecording> results = new ArrayList<>(originals.size()); in filterEndTimeIsPast() 149 for (ScheduledRecording r : originals) { in filterEndTimeIsPast() 158 public List<ScheduledRecording> getStartedRecordings() { in getStartedRecordings() 160 getRecordingsWithState(ScheduledRecording.STATE_RECORDING_IN_PROGRESS)); in getStartedRecordings() 164 public List<ScheduledRecording> getNonStartedScheduledRecordings() { in getNonStartedScheduledRecordings() 166 getRecordingsWithState(ScheduledRecording.STATE_RECORDING_NOT_STARTED)); in getNonStartedScheduledRecordings() [all …]
|
D | DvrDataManager.java | 44 List<ScheduledRecording> getAllScheduledRecordings(); in getAllScheduledRecordings() 49 List<ScheduledRecording> getStartedRecordings(); in getStartedRecordings() 54 List<ScheduledRecording> getNonStartedScheduledRecordings(); in getNonStartedScheduledRecordings() 78 List<ScheduledRecording> getRecordingsThatOverlapWith(Range<Long> period); in getRecordingsThatOverlapWith() 104 ScheduledRecording getScheduledRecording(long recordingId); in getScheduledRecording() 111 ScheduledRecording getScheduledRecordingForProgramId(long programId); in getScheduledRecordingForProgramId() 120 void onScheduledRecordingAdded(ScheduledRecording scheduledRecording); in onScheduledRecordingAdded() 122 void onScheduledRecordingRemoved(ScheduledRecording scheduledRecording); in onScheduledRecordingRemoved() 124 void onScheduledRecordingStatusChanged(ScheduledRecording scheduledRecording); in onScheduledRecordingStatusChanged()
|
D | RecordingTask.java | 79 private ScheduledRecording mScheduledRecording; 84 RecordingTask(ScheduledRecording scheduledRecording, Channel channel, in RecordingTask() 153 updateRecording(ScheduledRecording.buildFrom(mScheduledRecording) in onRecordingStopped() 154 .setState(ScheduledRecording.STATE_RECORDING_FINISHED).build()); in onRecordingStopped() 165 updateRecording(ScheduledRecording.buildFrom(mScheduledRecording) in onError() 166 .setState(ScheduledRecording.STATE_RECORDING_FAILED) in onError() 213 updateRecordingState(ScheduledRecording.STATE_RECORDING_FAILED); in failAndQuit() 229 mTvRecordingClient.startRecording(programId == ScheduledRecording.ID_NOT_SET ? null in handleStartRecording() 231 updateRecording(ScheduledRecording.buildFrom(mScheduledRecording) in handleStartRecording() 232 .setState(ScheduledRecording.STATE_RECORDING_IN_PROGRESS).build()); in handleStartRecording() [all …]
|
D | DvrManager.java | 75 public void addSchedule(Program program, List<ScheduledRecording> recordingsToOverride) { in addSchedule() 78 Collections.sort(recordingsToOverride, ScheduledRecording.PRIORITY_COMPARATOR); in addSchedule() 82 ScheduledRecording r = ScheduledRecording.builder(program) in addSchedule() 96 ScheduledRecording r = ScheduledRecording.builder(startTime, endTime) in addSchedule() 113 public void stopRecording(final ScheduledRecording recording) { in stopRecording() 129 public void removeScheduledRecording(ScheduledRecording scheduledRecording) { in removeScheduledRecording() 159 public List<ScheduledRecording> getScheduledRecordingsThatConflict(Program program) { in getScheduledRecordingsThatConflict() 162 … List<ScheduledRecording> overLap = mDataManager.getRecordingsThatOverlapWith(getPeriod(program)); in getScheduledRecordingsThatConflict() 192 …public boolean canTuneTo(Channel channel, List<ScheduledRecording> outConflictScheduledRecordings)… in canTuneTo() 224 void onStopRecordingRequested(ScheduledRecording scheduledRecording); in onStopRecordingRequested()
|
D | Scheduler.java | 56 …HandlerWrapper(Looper looper, ScheduledRecording scheduledRecording, RecordingTask recordingTask) { in HandlerWrapper() 99 List<ScheduledRecording> scheduledRecordings = mDataManager.getRecordingsThatOverlapWith( in updatePendingRecordings() 103 for (ScheduledRecording r : scheduledRecordings) { in updatePendingRecordings() 118 public void onScheduledRecordingAdded(ScheduledRecording scheduledRecording) { in onScheduledRecordingAdded() 128 public void onScheduledRecordingRemoved(ScheduledRecording scheduledRecording) { in onScheduledRecordingRemoved() 140 public void onScheduledRecordingStatusChanged(ScheduledRecording scheduledRecording) { in onScheduledRecordingStatusChanged() 144 private void scheduleRecordingSoon(ScheduledRecording scheduledRecording) { in scheduleRecordingSoon() 176 boolean startsWithin(ScheduledRecording scheduledRecording, long durationInMs) { in startsWithin()
|
D | WritableDvrDataManager.java | 32 void addScheduledRecording(ScheduledRecording scheduledRecording); in addScheduledRecording() 42 void removeScheduledRecording(ScheduledRecording ScheduledRecording); in removeScheduledRecording() argument 52 void updateScheduledRecording(ScheduledRecording r); in updateScheduledRecording()
|
D | DvrPlayActivity.java | 38 long recordingId = getIntent().getLongExtra(ScheduledRecording.RECORDING_ID_EXTRA, 0); in onCreate() 39 ScheduledRecording scheduledRecording = dvrDataManager.getScheduledRecording(recordingId); in onCreate()
|
D | ScheduledProgramReaper.java | 45 List<ScheduledRecording> recordings = mDvrDataManager.getAllScheduledRecordings(); in run() 47 for (ScheduledRecording r : recordings) { in run()
|
/packages/apps/TV/src/com/android/tv/dvr/provider/ |
D | AsyncDvrDbTask.java | 24 import com.android.tv.dvr.ScheduledRecording; 83 extends AsyncDvrDbTask<ScheduledRecording, Void, List<ScheduledRecording>> { 90 protected final List<ScheduledRecording> doInDvrBackground(ScheduledRecording... params) { in doInDvrBackground() 102 extends AsyncDvrDbTask<ScheduledRecording, Void, List<Integer>> { 108 protected final List<Integer> doInDvrBackground(ScheduledRecording... params) { in doInDvrBackground() 120 extends AsyncDvrDbTask<ScheduledRecording, Void, List<Integer>> { 126 protected final List<Integer> doInDvrBackground(ScheduledRecording... params) { in doInDvrBackground() 132 extends AsyncDvrDbTask<Void, Void, List<ScheduledRecording>> { 139 protected final List<ScheduledRecording> doInDvrBackground(Void... params) { in doInDvrBackground() 150 List<ScheduledRecording> scheduledRecordings = new ArrayList<>(); in doInDvrBackground() [all …]
|
D | DvrDatabaseHelper.java | 27 import com.android.tv.dvr.ScheduledRecording; 95 public List<ScheduledRecording> insertRecordings(ScheduledRecording... scheduledRecordings) { in insertRecordings() 99 List<ScheduledRecording> results = new ArrayList<>(); in insertRecordings() 100 for (ScheduledRecording r : scheduledRecordings) { in insertRecordings() 101 ContentValues values = ScheduledRecording.toContentValues(r); in insertRecordings() 103 results.add(ScheduledRecording.buildFrom(r).setId(id).build()); in insertRecordings() 114 public List<Integer> updateRecordings(ScheduledRecording[] scheduledRecordings) { in updateRecordings() 118 for (ScheduledRecording r : scheduledRecordings) { in updateRecordings() 119 ContentValues values = ScheduledRecording.toContentValues(r); in updateRecordings() 127 private void updateChannelsFromRecordings(ScheduledRecording[] scheduledRecordings) { in updateChannelsFromRecordings() [all …]
|
/packages/apps/TV/tests/common/src/com/android/tv/testing/dvr/ |
D | RecordingTestUtils.java | 20 import com.android.tv.dvr.ScheduledRecording; 28 public static ScheduledRecording createTestRecordingWithIdAndPeriod(long id, long channelId, in createTestRecordingWithIdAndPeriod() 30 return ScheduledRecording.builder(startTime, endTime) in createTestRecordingWithIdAndPeriod() 36 public static ScheduledRecording createTestRecordingWithPeriod(long channelId, long startTime, in createTestRecordingWithPeriod() 38 return createTestRecordingWithIdAndPeriod(ScheduledRecording.ID_NOT_SET, channelId, in createTestRecordingWithPeriod() 42 public static ScheduledRecording addScheduledRecording( in addScheduledRecording() 45 ScheduledRecording recording = createTestRecordingWithPeriod(channelId, startTime, endTime); in addScheduledRecording() 50 public static ScheduledRecording normalizePriority(ScheduledRecording orig){ in normalizePriority() 51 return ScheduledRecording.buildFrom(orig).setPriority(orig.getId()).build(); in normalizePriority() 54 … public static void assertRecordingEquals(ScheduledRecording expected, ScheduledRecording actual) { in assertRecordingEquals()
|
/packages/apps/TV/src/com/android/tv/dvr/ui/ |
D | ScheduledRecordingsAdapter.java | 22 import com.android.tv.dvr.ScheduledRecording; 28 final class ScheduledRecordingsAdapter extends SortedArrayAdapter<ScheduledRecording> 35 super(presenterSelector, ScheduledRecording.START_TIME_THEN_PRIORITY_COMPARATOR); in ScheduledRecordingsAdapter() 43 case ScheduledRecording.STATE_RECORDING_NOT_STARTED: in start() 46 case ScheduledRecording.STATE_RECORDING_IN_PROGRESS: in start() 61 long getId(ScheduledRecording item) { in getId() 66 public void onScheduledRecordingAdded(ScheduledRecording scheduledRecording) { in onScheduledRecordingAdded() 73 public void onScheduledRecordingRemoved(ScheduledRecording scheduledRecording) { in onScheduledRecordingRemoved() 78 public void onScheduledRecordingStatusChanged(ScheduledRecording scheduledRecording) { in onScheduledRecordingStatusChanged()
|
D | ScheduledRecordingPresenter.java | 37 import com.android.tv.dvr.ScheduledRecording; 69 final ScheduledRecording recording = (ScheduledRecording) o; in onBindViewHolder() 74 if (programId == ScheduledRecording.ID_NOT_SET) { in onBindViewHolder() 95 case ScheduledRecording.STATE_RECORDING_NOT_STARTED: { in onBindViewHolder() 99 case ScheduledRecording.STATE_RECORDING_IN_PROGRESS: { in onBindViewHolder() 109 private void setTitleAndImage(RecordingCardView cardView, ScheduledRecording recording, in setTitleAndImage() 136 final ScheduledRecording recording) { in showScheduledRecordingDialog() 144 dvrManager.removeScheduledRecording((ScheduledRecording) recording); in showScheduledRecordingDialog() 155 final ScheduledRecording recording) { in showCurrentlyRecordingDialog() 162 dvrManager.stopRecording((ScheduledRecording) recording); in showCurrentlyRecordingDialog()
|
D | DvrBrowseFragment.java | 34 import com.android.tv.dvr.ScheduledRecording; 117 presenterSelector.addClassPresenter(ScheduledRecording.class, scheduledRecordingPresenter); in setupAdapters() 121 ScheduledRecording.STATE_RECORDING_IN_PROGRESS, presenterSelector); in setupAdapters() 123 ScheduledRecording.STATE_RECORDING_NOT_STARTED, presenterSelector); in setupAdapters()
|
D | DvrRecordConflictFragment.java | 17 import com.android.tv.dvr.ScheduledRecording; 28 private List<ScheduledRecording> mConflicts; 46 for (ScheduledRecording r : mConflicts) { in onCreateGuidance()
|
/packages/apps/TV/src/com/android/tv/menu/ |
D | RecordCardView.java | 34 import com.android.tv.dvr.ScheduledRecording; 55 private ScheduledRecording mCurrentRecording; 78 for (ScheduledRecording recording : mDvrDataManager.getStartedRecordings()) { in onBind() 157 public void onScheduledRecordingAdded(ScheduledRecording recording) { in onScheduledRecordingAdded() 161 public void onScheduledRecordingRemoved(ScheduledRecording recording) { in onScheduledRecordingRemoved() 173 public void onScheduledRecordingStatusChanged(ScheduledRecording recording) { in onScheduledRecordingStatusChanged() 178 if (state == ScheduledRecording.STATE_RECORDING_FAILED in onScheduledRecordingStatusChanged() 179 || state == ScheduledRecording.STATE_RECORDING_FINISHED) { in onScheduledRecordingStatusChanged() 183 } else if (state == ScheduledRecording.STATE_RECORDING_IN_PROGRESS) { in onScheduledRecordingStatusChanged()
|
/packages/apps/TV/src/com/android/tv/guide/ |
D | ProgramManager.java | 30 import com.android.tv.dvr.ScheduledRecording; 81 public final ScheduledRecording scheduledRecording; 105 private TableEntry(long channelId, Program program, ScheduledRecording scheduledRecording, in TableEntry() 215 public void onScheduledRecordingAdded(ScheduledRecording scheduledRecording) { 226 public void onScheduledRecordingRemoved(ScheduledRecording scheduledRecording) { 237 public void onScheduledRecordingStatusChanged(ScheduledRecording scheduledRecording) { 490 private TableEntry getTableEntry(ScheduledRecording scheduledRecording) { in getTableEntry() 623 ScheduledRecording scheduledRecording = mDvrDataManager == null ? null in createProgramEntries()
|