Home | History | Annotate | Download | only in provider
      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.provider;
     18 
     19 import android.provider.BaseColumns;
     20 
     21 /**
     22  * The contract between the DVR provider and applications. Contains definitions for the supported
     23  * columns. It's for the internal use in Live TV.
     24  */
     25 public final class DvrContract {
     26     /** Column definition for Recording table. */
     27     public static final class Recordings implements BaseColumns {
     28         /** The table name. */
     29         public static final String TABLE_NAME = "recording";
     30 
     31         /** The recording type for program recording. */
     32         public static final String TYPE_PROGRAM = "TYPE_PROGRAM";
     33 
     34         /** The recording type for timed recording. */
     35         public static final String TYPE_TIMED = "TYPE_TIMED";
     36 
     37         /** The recording type for season recording. */
     38         public static final String TYPE_SEASON_RECORDING = "TYPE_SEASON_RECORDING";
     39 
     40         /** The recording has not been started yet. */
     41         public static final String STATE_RECORDING_NOT_STARTED = "STATE_RECORDING_NOT_STARTED";
     42 
     43         /** The recording is in progress. */
     44         public static final String STATE_RECORDING_IN_PROGRESS = "STATE_RECORDING_IN_PROGRESS";
     45 
     46         /** The recording was unexpectedly stopped. */
     47         public static final String STATE_RECORDING_UNEXPECTEDLY_STOPPED =
     48                 "STATE_RECORDING_UNEXPECTEDLY_STOPPED";
     49 
     50         /** The recording is finished. */
     51         public static final String STATE_RECORDING_FINISHED = "STATE_RECORDING_FINISHED";
     52 
     53         /**
     54          * The priority of this recording.
     55          *
     56          * <p> The lowest number is recorded first. If there is a tie in priority then the lower id
     57          * wins.  Defaults to {@value Long#MAX_VALUE}
     58          *
     59          * <p>Type: INTEGER (long)
     60          */
     61         public static final String COLUMN_PRIORITY = "priority";
     62 
     63         /**
     64          * The type of this recording.
     65          *
     66          * <p>This value should be one of the followings: {@link #TYPE_PROGRAM},
     67          * {@link #TYPE_TIMED}, and {@link #TYPE_SEASON_RECORDING}.
     68          *
     69          * <p>This is a required field.
     70          *
     71          * <p>Type: String
     72          */
     73         public static final String COLUMN_TYPE = "type";
     74 
     75         /**
     76          * The ID of the channel for recording.
     77          *
     78          * <p>This is a required field.
     79          *
     80          * <p>Type: INTEGER (long)
     81          */
     82         public static final String COLUMN_CHANNEL_ID = "channel_id";
     83 
     84 
     85         /**
     86          * The  ID of the associated program for recording.
     87          *
     88          * <p>This is an optional field.
     89          *
     90          * <p>Type: INTEGER (long)
     91          */
     92         public static final String COLUMN_PROGRAM_ID = "program_id";
     93 
     94         /**
     95          * The start time of this recording, in milliseconds since the epoch.
     96          *
     97          * <p>This is a required field.
     98          *
     99          * <p>Type: INTEGER (long)
    100          */
    101         public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
    102 
    103         /**
    104          * The end time of this recording, in milliseconds since the epoch.
    105          *
    106          * <p>This is a required field.
    107          *
    108          * <p>Type: INTEGER (long)
    109          */
    110         public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
    111 
    112         /**
    113          * The state of this recording.
    114          *
    115          * <p>This value should be one of the followings: {@link #STATE_RECORDING_NOT_STARTED},
    116          * {@link #STATE_RECORDING_IN_PROGRESS}, {@link #STATE_RECORDING_UNEXPECTEDLY_STOPPED},
    117          * and {@link #STATE_RECORDING_FINISHED}.
    118          *
    119          * <p>This is a required field.
    120          *
    121          * <p>Type: String
    122          */
    123         public static final String COLUMN_STATE = "state";
    124 
    125         private Recordings() { }
    126     }
    127 
    128     private DvrContract() { }
    129 }
    130