1 /* 2 * Copyright (C) 2015 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.dvr; 18 19 import android.support.annotation.MainThread; 20 21 import com.android.tv.dvr.data.ScheduledRecording; 22 import com.android.tv.dvr.data.ScheduledRecording.RecordingState; 23 import com.android.tv.dvr.data.SeriesRecording; 24 25 /** 26 * Full data manager. 27 * 28 * <p>The following operations need to be synced with permanent storage. The following commands are 29 * for internal use only. Do not call them from UI directly. 30 */ 31 @MainThread 32 public interface WritableDvrDataManager extends DvrDataManager { 33 /** 34 * Adds new recordings. 35 */ 36 void addScheduledRecording(ScheduledRecording... scheduledRecordings); 37 38 /** 39 * Adds new series recordings. 40 */ 41 void addSeriesRecording(SeriesRecording... seriesRecordings); 42 43 /** 44 * Removes recordings. 45 */ 46 void removeScheduledRecording(ScheduledRecording... scheduledRecordings); 47 48 /** 49 * Removes recordings. If {@code forceRemove} is {@code true}, the schedule will be permanently 50 * removed instead of changing the state to DELETED. 51 */ 52 void removeScheduledRecording(boolean forceRemove, ScheduledRecording... scheduledRecordings); 53 54 /** 55 * Removes series recordings. 56 */ 57 void removeSeriesRecording(SeriesRecording... seasonSchedules); 58 59 /** 60 * Updates existing recordings. 61 */ 62 void updateScheduledRecording(ScheduledRecording... scheduledRecordings); 63 64 /** 65 * Updates existing series recordings. 66 */ 67 void updateSeriesRecording(SeriesRecording... seriesRecordings); 68 69 /** 70 * Changes the state of the recording. 71 */ 72 void changeState(ScheduledRecording scheduledRecording, @RecordingState int newState); 73 74 /** 75 * Remove all the records related to the input. 76 * <p> 77 * Note that this should be called after the input was removed. 78 */ 79 void forgetStorage(String inputId); 80 } 81