Home | History | Annotate | Download | only in dvr

Lines Matching refs:schedule

92     // the boolean value true denotes the schedule is just partially conflicting, which means
128 for (ScheduledRecording schedule : scheduledRecordings) {
129 if (!schedule.isNotStarted() && !schedule.isInProgress()) {
133 .getTvInputInfoForInputId(mContext, schedule.getInputId());
135 "Input was removed for : " + schedule)) {
137 mInputScheduleMap.remove(schedule.getInputId());
138 mInputConflictInfoMap.remove(schedule.getInputId());
147 schedules.add(schedule);
158 for (ScheduledRecording schedule : scheduledRecordings) {
160 .getTvInputInfoForInputId(mContext, schedule.getInputId());
163 mInputScheduleMap.remove(schedule.getInputId());
164 mInputConflictInfoMap.remove(schedule.getInputId());
170 schedules.remove(schedule);
177 conflictInfo.remove(schedule.getId());
193 for (ScheduledRecording schedule : scheduledRecordings) {
195 .getTvInputInfoForInputId(mContext, schedule.getInputId());
197 "Input was removed for : " + schedule)) {
199 mInputScheduleMap.remove(schedule.getInputId());
200 mInputConflictInfoMap.remove(schedule.getInputId());
212 if (i.next().getId() == schedule.getId()) {
217 if (schedule.isNotStarted() || schedule.isInProgress()) {
218 schedules.add(schedule);
226 ConflictInfo oldConflictInfo = conflictInfo.get(schedule.getId());
228 oldConflictInfo.schedule = schedule;
269 for (ScheduledRecording schedule : schedules) {
270 if (schedule.getState() == ScheduledRecording.STATE_RECORDING_IN_PROGRESS) {
271 result.add(schedule);
280 for (ScheduledRecording schedule : mDataManager.getAllScheduledRecordings()) {
281 if (!schedule.isNotStarted() && !schedule.isInProgress()) {
284 Channel channel = mChannelDataManager.getChannel(schedule.getChannelId());
294 schedules.add(schedule);
314 oldConflictMap.put(conflictInfo.schedule.getId(), conflictInfo.schedule);
323 conflictInfos.put(conflictInfo.schedule.getId(), conflictInfo);
324 if (oldConflictMap.remove(conflictInfo.schedule.getId()) == null) {
325 addedConflicts.add(conflictInfo.schedule);
449 for (ScheduledRecording schedule : mDataManager.getAllScheduledRecordings()) {
450 if (schedule.getPriority() > highestPriority) {
451 highestPriority = schedule.getPriority();
458 * Suggests the higher priority than the schedules which overlap with {@code schedule}.
460 public long suggestHighestPriority(ScheduledRecording schedule) {
461 List<ScheduledRecording> schedules = mInputScheduleMap.get(schedule.getInputId());
467 if (!r.equals(schedule) && r.isOverLapping(schedule)
472 if (highestPriority == Long.MIN_VALUE || highestPriority < schedule.getPriority()) {
473 return schedule.getPriority();
479 * Suggests the higher priority than the schedules which overlap with {@code schedule}.
521 for (SeriesRecording schedule : mDataManager.getSeriesRecordings()) {
522 if (schedule.getPriority() > highestPriority) {
523 highestPriority = schedule.getPriority();
534 * the first recording in the returned list should be assigned to the new schedule of this
593 * the first recording in the returned list should be assigned to the new schedule of this
634 * Checks if the schedule is conflicting.
636 * <p>Note that the {@code schedule} should be the existing one. If not, this returns
639 public boolean isConflicting(ScheduledRecording schedule) {
641 TvInputInfo input = Utils.getTvInputInfoForInputId(mContext, schedule.getInputId());
643 + schedule.getChannelId());
648 return conflicts != null && conflicts.containsKey(schedule.getId());
652 * Checks if the schedule is partially conflicting, i.e., part of the scheduled program might be
653 * recorded even if the priority of the schedule is not raised.
655 * If the given schedule is not conflicting or is totally conflicting, i.e., cannot be recorded
658 public boolean isPartiallyConflicting(@NonNull ScheduledRecording schedule) {
660 TvInputInfo input = Utils.getTvInputInfoForInputId(mContext, schedule.getInputId());
662 + schedule.getChannelId());
668 ConflictInfo conflictInfo = conflicts.get(schedule.getId());
697 for (ScheduledRecording schedule : startedRecordings) {
698 if (schedule.getChannelId() == channelId) {
759 for (ScheduledRecording schedule : schedules) {
760 if (schedule.getChannelId() == channelId) {
761 schedulesSameChannel.add(schedule);
762 schedulesToCheck.remove(schedule);
781 // When the duplicate schedule is to be added, remove the current duplicate recording.
783 ScheduledRecording schedule = iter.next();
785 if (schedule.getType() == ScheduledRecording.TYPE_PROGRAM) {
786 if (toAdd.getProgramId() == schedule.getProgramId()) {
791 if (toAdd.getChannelId() == schedule.getChannelId()
792 && toAdd.getStartTimeMs() == schedule.getStartTimeMs()
793 && toAdd.getEndTimeMs() == schedule.getEndTimeMs()) {
802 for (ScheduledRecording schedule : schedulesToAdd) {
803 ranges.add(new Range<>(schedule.getStartTimeMs(), schedule.getEndTimeMs()));
822 result.add(conflictInfo.schedule);
854 ScheduledRecording schedule = schedulesToCheck.remove(0);
855 removeFinishedRecordings(recordings, schedule.getStartTimeMs());
857 recordings.add(schedule);
858 if (modified2OriginalSchedules.containsKey(schedule)) {
859 // Schedule has been modified, which means it's already conflicted.
861 ScheduledRecording originalSchedule = modified2OriginalSchedules.get(schedule);
865 ScheduledRecording candidate = findReplaceableRecording(recordings, schedule);
871 recordings.add(schedule);
872 if (modified2OriginalSchedules.containsKey(schedule)) {
873 // Schedule has been modified, which means it's already conflicted.
876 modified2OriginalSchedules.get(schedule);
880 if (!modified2OriginalSchedules.containsKey(schedule)) {
881 // if schedule has been modified, it's already conflicted.
883 conflicts.put(schedule, new ConflictInfo(schedule, false));
886 if (earliestEndTime < schedule.getEndTimeMs()) {
887 // The schedule can starts when other recording ends even though it's
889 ScheduledRecording modifiedSchedule = ScheduledRecording.buildFrom(schedule)
892 modified2OriginalSchedules.getOrDefault(schedule, schedule);
911 ScheduledRecording schedule = iter.next();
913 if (schedule.isOverLapping(period)) {
927 return RESULT_COMPARATOR.compare(lhs.schedule, rhs.schedule);
946 ScheduledRecording schedule) {
950 // 3. If 1) and 2) are the same, the early created schedule is returned.
953 if (schedule.getPriority() > recording.getPriority()) {
974 public ScheduledRecording schedule;
977 ConflictInfo(ScheduledRecording schedule, boolean partialConflict) {
978 this.schedule = schedule;
984 * A listener which is notified the initialization of schedule manager.
988 * Called when the schedule manager has been initialized.