aboutsummaryrefslogtreecommitdiff
path: root/src/com/android/tv/dvr/provider/DvrContract.java
blob: f0aca18e218c06a0e627ab0bb0cc8762e45a6046 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.tv.dvr.provider;

import android.provider.BaseColumns;

/**
 * The contract between the DVR provider and applications. Contains definitions for the supported
 * columns. It's for the internal use in Live TV.
 */
public final class DvrContract {
    /** Column definition for Schedules table. */
    public static final class Schedules implements BaseColumns {
        /** The table name. */
        public static final String TABLE_NAME = "schedules";

        /** The recording type for program recording. */
        public static final String TYPE_PROGRAM = "TYPE_PROGRAM";

        /** The recording type for timed recording. */
        public static final String TYPE_TIMED = "TYPE_TIMED";

        /** The recording has not been started yet. */
        public static final String STATE_RECORDING_NOT_STARTED = "STATE_RECORDING_NOT_STARTED";

        /** The recording is in progress. */
        public static final String STATE_RECORDING_IN_PROGRESS = "STATE_RECORDING_IN_PROGRESS";

        /** The recording is finished. */
        public static final String STATE_RECORDING_FINISHED = "STATE_RECORDING_FINISHED";

        /** The recording failed. */
        public static final String STATE_RECORDING_FAILED = "STATE_RECORDING_FAILED";

        /** The recording finished and clipping. */
        public static final String STATE_RECORDING_CLIPPED = "STATE_RECORDING_CLIPPED";

        /** The recording marked as deleted. */
        public static final String STATE_RECORDING_DELETED = "STATE_RECORDING_DELETED";

        /** The recording marked as canceled. */
        public static final String STATE_RECORDING_CANCELED = "STATE_RECORDING_CANCELED";

        /**
         * The priority of this recording.
         *
         * <p> The lowest number is recorded first. If there is a tie in priority then the lower id
         * wins.  Defaults to {@value Long#MAX_VALUE}
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_PRIORITY = "priority";

        /**
         * The type of this recording.
         *
         * <p>This value should be one of the followings: {@link #TYPE_PROGRAM} and
         * {@link #TYPE_TIMED}.
         *
         * <p>This is a required field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_TYPE = "type";

        /**
         * The input id of recording.
         *
         * <p>This is a required field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_INPUT_ID = "input_id";

        /**
         * The ID of the channel for recording.
         *
         * <p>This is a required field.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_CHANNEL_ID = "channel_id";

        /**
         * The ID of the associated program for recording.
         *
         * <p>This is an optional field.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_PROGRAM_ID = "program_id";

        /**
         * The title of the associated program for recording.
         *
         * <p>This is an optional field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PROGRAM_TITLE = "program_title";

        /**
         * The start time of this recording, in milliseconds since the epoch.
         *
         * <p>This is a required field.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";

        /**
         * The end time of this recording, in milliseconds since the epoch.
         *
         * <p>This is a required field.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";

        /**
         * The season number of this program for episodic TV shows.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_SEASON_NUMBER = "season_number";

        /**
         * The episode number of this program for episodic TV shows.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_EPISODE_NUMBER = "episode_number";

        /**
         * The episode title of this program for episodic TV shows.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_EPISODE_TITLE = "episode_title";

        /**
         * The description of program.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PROGRAM_DESCRIPTION = "program_description";

        /**
         * The long description of program.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PROGRAM_LONG_DESCRIPTION = "program_long_description";

        /**
         * The poster art uri of program.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PROGRAM_POST_ART_URI = "program_poster_art_uri";

        /**
         * The thumbnail uri of program.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PROGRAM_THUMBNAIL_URI = "program_thumbnail_uri";

        /**
         * The state of this recording.
         *
         * <p>This value should be one of the followings: {@link #STATE_RECORDING_NOT_STARTED},
         * {@link #STATE_RECORDING_IN_PROGRESS}, {@link #STATE_RECORDING_FINISHED},
         * {@link #STATE_RECORDING_FAILED}, {@link #STATE_RECORDING_CLIPPED} and
         * {@link #STATE_RECORDING_DELETED}.
         *
         * <p>This is a required field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_STATE = "state";

        /**
         * The ID of the parent series recording.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_SERIES_RECORDING_ID = "series_recording_id";

        private Schedules() { }
    }

    /** Column definition for Recording table. */
    public static final class SeriesRecordings implements BaseColumns {
        /** The table name. */
        public static final String TABLE_NAME = "series_recording";

        /**
         * This value is used for {@link #COLUMN_START_FROM_SEASON} and
         * {@link #COLUMN_START_FROM_EPISODE} to mean record all seasons or episodes.
         */
        public static final int THE_BEGINNING = -1;

        /**
         * The series recording option which indicates that the episodes in one channel are
         * recorded.
         */
        public static final String OPTION_CHANNEL_ONE = "OPTION_CHANNEL_ONE";

        /**
         * The series recording option which indicates that the episodes in all the channels are
         * recorded.
         */
        public static final String OPTION_CHANNEL_ALL = "OPTION_CHANNEL_ALL";

        /**
         * The state indicates that it is a normal one.
         */
        public static final String STATE_SERIES_NORMAL = "STATE_SERIES_NORMAL";

        /**
         * The state indicates that it is stopped.
         */
        public static final String STATE_SERIES_STOPPED = "STATE_SERIES_STOPPED";

        /**
         * The priority of this recording.
         *
         * <p> The lowest number is recorded first. If there is a tie in priority then the lower id
         * wins.  Defaults to {@value Long#MAX_VALUE}
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_PRIORITY = "priority";

        /**
         * The input id of recording.
         *
         * <p>This is a required field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_INPUT_ID = "input_id";

        /**
         * The ID of the channel for recording.
         *
         * <p>This is a required field.
         *
         * <p>Type: INTEGER (long)
         */
        public static final String COLUMN_CHANNEL_ID = "channel_id";

        /**
         * The  ID of the associated series to record.
         *
         * <p>The id is an opaque but stable string.
         *
         * <p>This is an optional field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_SERIES_ID = "series_id";

        /**
         * The title of the series.
         *
         * <p>This is a required field.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_TITLE = "title";

        /**
         * The short description of the series.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_SHORT_DESCRIPTION = "short_description";

        /**
         * The long description of the series.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_LONG_DESCRIPTION = "long_description";

        /**
         * The number of the earliest season to record. The
         * value {@link #THE_BEGINNING} means record all seasons.
         *
         * <p>Default value is {@value #THE_BEGINNING} {@link #THE_BEGINNING}.
         *
         * <p>Type: INTEGER (int)
         */
        public static final String COLUMN_START_FROM_SEASON = "start_from_season";

        /**
         * The number of the earliest episode to record in {@link #COLUMN_START_FROM_SEASON}.  The
         * value {@link #THE_BEGINNING} means record all episodes.
         *
         * <p>Default value is {@value #THE_BEGINNING} {@link #THE_BEGINNING}.
         *
         * <p>Type: INTEGER (int)
         */
        public static final String COLUMN_START_FROM_EPISODE = "start_from_episode";

        /**
         * The series recording option which indicates the channels to record.
         *
         * <p>This value should be one of the followings: {@link #OPTION_CHANNEL_ONE} and
         * {@link #OPTION_CHANNEL_ALL}. The default value is OPTION_CHANNEL_ONE.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_CHANNEL_OPTION = "channel_option";

        /**
         * The comma-separated canonical genre string of this series.
         *
         * <p>Canonical genres are defined in {@link android.media.tv.TvContract.Programs.Genres}.
         * Use {@link android.media.tv.TvContract.Programs.Genres#encode} to create a text that can
         * be stored in this column. Use {@link android.media.tv.TvContract.Programs.Genres#decode}
         * to get the canonical genre strings from the text stored in the column.
         *
         * <p>Type: TEXT
         * @see android.media.tv.TvContract.Programs.Genres
         * @see android.media.tv.TvContract.Programs.Genres#encode
         * @see android.media.tv.TvContract.Programs.Genres#decode
         */
        public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";

        /**
         * The URI for the poster of this TV series.
         *
         * <p>The data in the column must be a URL, or a URI in one of the following formats:
         *
         * <ul>
         * <li>content ({@link android.content.ContentResolver#SCHEME_CONTENT})</li>
         * <li>android.resource ({@link android.content.ContentResolver#SCHEME_ANDROID_RESOURCE})
         * </li>
         * <li>file ({@link android.content.ContentResolver#SCHEME_FILE})</li>
         * </ul>
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_POSTER_URI = "poster_uri";

        /**
         * The URI for the photo of this TV program.
         *
         * <p>The data in the column must be a URL, or a URI in one of the following formats:
         *
         * <ul>
         * <li>content ({@link android.content.ContentResolver#SCHEME_CONTENT})</li>
         * <li>android.resource ({@link android.content.ContentResolver#SCHEME_ANDROID_RESOURCE})
         * </li>
         * <li>file ({@link android.content.ContentResolver#SCHEME_FILE})</li>
         * </ul>
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_PHOTO_URI = "photo_uri";

        /**
         * The state of whether the series recording be canceled or not.
         *
         * <p>This value should be one of the followings: {@link #STATE_SERIES_NORMAL} and
         * {@link #STATE_SERIES_STOPPED}. The default value is STATE_SERIES_NORMAL.
         *
         * <p>Type: TEXT
         */
        public static final String COLUMN_STATE = "state";

        private SeriesRecordings() { }
    }

    private DvrContract() { }
}