Merge "Add more columns to help identify TV channels"
This commit is contained in:
@@ -20,6 +20,7 @@ import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.net.Uri;
|
||||
import android.tv.TvInputService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -139,9 +140,9 @@ public final class TvContract {
|
||||
*
|
||||
* @param channelUri The URI of the channel to return programs for.
|
||||
* @param startTime The start time used to filter programs. The returned programs should have
|
||||
* {@link Programs#END_TIME_UTC_MILLIS} that is greater than this time.
|
||||
* {@link Programs#COLUMN_END_TIME_UTC_MILLIS} that is greater than this time.
|
||||
* @param endTime The end time used to filter programs. The returned programs should have
|
||||
* {@link Programs#START_TIME_UTC_MILLIS} that is less than this time.
|
||||
* {@link Programs#COLUMN_START_TIME_UTC_MILLIS} that is less than this time.
|
||||
*/
|
||||
public static final Uri buildProgramsUriForChannel(Uri channelUri, long startTime,
|
||||
long endTime) {
|
||||
@@ -161,7 +162,7 @@ public final class TvContract {
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the {@link Channels#PACKAGE_NAME} from a given URI.
|
||||
* Extracts the {@link Channels#COLUMN_PACKAGE_NAME} from a given URI.
|
||||
*
|
||||
* @param channelsUri A URI constructed by {@link #buildChannelsUriForInput(ComponentName)} or
|
||||
* {@link #buildChannelsUriForInput(ComponentName, boolean)}.
|
||||
@@ -179,7 +180,7 @@ public final class TvContract {
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the {@link Channels#SERVICE_NAME} from a given URI.
|
||||
* Extracts the {@link Channels#COLUMN_SERVICE_NAME} from a given URI.
|
||||
*
|
||||
* @param channelsUri A URI constructed by {@link #buildChannelsUriForInput(ComponentName)} or
|
||||
* {@link #buildChannelsUriForInput(ComponentName, boolean)}.
|
||||
@@ -231,7 +232,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String PACKAGE_NAME = "package_name";
|
||||
public static final String COLUMN_PACKAGE_NAME = "package_name";
|
||||
}
|
||||
|
||||
/** Column definitions for the TV channels table. */
|
||||
@@ -279,14 +280,14 @@ public final class TvContract {
|
||||
/** The channel type for DVB-SH (satellite). */
|
||||
public static final int TYPE_DVB_SH = 0x00020400;
|
||||
|
||||
/** The channel type for ATSC (terrestrial/cable). */
|
||||
public static final int TYPE_ATSC = 0x00030000;
|
||||
/** The channel type for ATSC (terrestrial). */
|
||||
public static final int TYPE_ATSC_T = 0x00030000;
|
||||
|
||||
/** The channel type for ATSC 2.0. */
|
||||
public static final int TYPE_ATSC_2_0 = 0x00030001;
|
||||
/** The channel type for ATSC (cable). */
|
||||
public static final int TYPE_ATSC_C = 0x00030200;
|
||||
|
||||
/** The channel type for ATSC-M/H (mobile/handheld). */
|
||||
public static final int TYPE_ATSC_M_H = 0x00030100;
|
||||
public static final int TYPE_ATSC_M_H = 0x00030200;
|
||||
|
||||
/** The channel type for ISDB-T (terrestrial). */
|
||||
public static final int TYPE_ISDB_T = 0x00040000;
|
||||
@@ -315,49 +316,124 @@ public final class TvContract {
|
||||
/** The channel type for S-DMB (satellite). */
|
||||
public static final int TYPE_S_DMB = 0x00060100;
|
||||
|
||||
/** A generic service type. */
|
||||
public static final int SERVICE_TYPE_OTHER = 0x0;
|
||||
|
||||
/** The service type for regular TV channels. */
|
||||
public static final int SERVICE_TYPE_TV = 0x1;
|
||||
|
||||
/** The service type for radio channels. */
|
||||
public static final int SERVICE_TYPE_RADIO = 0x2;
|
||||
|
||||
/**
|
||||
* The name of the TV input service that provides this TV channel.
|
||||
* The name of the {@link TvInputService} subclass that provides this TV channel. This
|
||||
* should be a fully qualified class name (such as, "com.example.project.TvInputService").
|
||||
* <p>
|
||||
* This is a required field.
|
||||
* </p><p>
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String SERVICE_NAME = "service_name";
|
||||
public static final String COLUMN_SERVICE_NAME = "service_name";
|
||||
|
||||
/**
|
||||
* The predefined type of this TV channel.
|
||||
* <p>
|
||||
* This is used to indicate which broadcast standard (e.g. ATSC, DVB or ISDB) the current
|
||||
* channel conforms to.
|
||||
* This is primarily used to indicate which broadcast standard (e.g. ATSC, DVB or ISDB) the
|
||||
* current channel conforms to, with an exception being {@link #TYPE_PASSTHROUGH}, which is
|
||||
* a special channel type used only by pass-through inputs such as HDMI. The value should
|
||||
* match to one of the followings: {@link #TYPE_OTHER}, {@link #TYPE_PASSTHROUGH},
|
||||
* {@link #TYPE_DVB_T}, {@link #TYPE_DVB_T2}, {@link #TYPE_DVB_S}, {@link #TYPE_DVB_S2},
|
||||
* {@link #TYPE_DVB_C}, {@link #TYPE_DVB_C2}, {@link #TYPE_DVB_H}, {@link #TYPE_DVB_SH},
|
||||
* {@link #TYPE_ATSC_T}, {@link #TYPE_ATSC_C}, {@link #TYPE_ATSC_M_H}, {@link #TYPE_ISDB_T},
|
||||
* {@link #TYPE_ISDB_TB}, {@link #TYPE_ISDB_S}, {@link #TYPE_ISDB_C} {@link #TYPE_1SEG},
|
||||
* {@link #TYPE_DTMB}, {@link #TYPE_CMMB}, {@link #TYPE_T_DMB}, {@link #TYPE_S_DMB}
|
||||
* </p><p>
|
||||
* This is a required field.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String TYPE = "type";
|
||||
public static final String COLUMN_TYPE = "type";
|
||||
|
||||
/**
|
||||
* The transport stream ID as appeared in various broadcast standards.
|
||||
* The predefined service type of this TV channel.
|
||||
* <p>
|
||||
* This is not a required field but if provided, can significantly increase the accuracy of
|
||||
* channel identification.
|
||||
* This is primarily used to indicate whether the current channel is a regular TV channel or
|
||||
* a radio-like channel. Use the same coding for {@code service_type} in the underlying
|
||||
* broadcast standard if it is defined there (e.g. ATSC A/53, ETSI EN 300 468 and ARIB
|
||||
* STD-B10). Otherwise use one of the followings: {@link #SERVICE_TYPE_OTHER},
|
||||
* {@link #SERVICE_TYPE_TV}, {@link #SERVICE_TYPE_RADIO}
|
||||
* </p><p>
|
||||
* This is a required field.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String TRANSPORT_STREAM_ID = "transport_stream_id";
|
||||
public static final String COLUMN_SERVICE_TYPE = "service_type";
|
||||
|
||||
/**
|
||||
* The original network ID of this TV channel.
|
||||
* <p>
|
||||
* This is used to identify the originating delivery system, if applicable. Use the same
|
||||
* coding for {@code origianal_network_id} in the underlying broadcast standard if it is
|
||||
* defined there (e.g. ETSI EN 300 468/TR 101 211 and ARIB STD-B10). If channels cannot be
|
||||
* globally identified by 2-tuple {{@link #COLUMN_TRANSPORT_STREAM_ID},
|
||||
* {@link #COLUMN_SERVICE_ID}}, one must carefully assign a value to this field to form a
|
||||
* unique 3-tuple identification {{@link #COLUMN_ORIGINAL_NETWORK_ID},
|
||||
* {@link #COLUMN_TRANSPORT_STREAM_ID}, {@link #COLUMN_SERVICE_ID}} for its channels.
|
||||
* </p><p>
|
||||
* This is a required field if the channel cannot be uniquely identified by a 2-tuple
|
||||
* {{@link #COLUMN_TRANSPORT_STREAM_ID}, {@link #COLUMN_SERVICE_ID}}.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String COLUMN_ORIGINAL_NETWORK_ID = "original_network_id";
|
||||
|
||||
/**
|
||||
* The transport stream ID of this channel.
|
||||
* <p>
|
||||
* This is used to identify the Transport Stream that contains the current channel from any
|
||||
* other multiplex within a network, if applicable. Use the same coding for
|
||||
* {@code transport_stream_id} defined in ISO/IEC 13818-1 if the channel is transmitted via
|
||||
* the MPEG Transport Stream as is the case for many digital broadcast standards.
|
||||
* </p><p>
|
||||
* This is a required field if the current channel is transmitted via the MPEG Transport
|
||||
* Stream.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String COLUMN_TRANSPORT_STREAM_ID = "transport_stream_id";
|
||||
|
||||
/**
|
||||
* The service ID of this channel.
|
||||
* <p>
|
||||
* This is used to identify the current service (roughly equivalent to channel) from any
|
||||
* other service within the Transport Stream, if applicable. Use the same coding for
|
||||
* {@code service_id} in the underlying broadcast standard if it is defined there (e.g. ETSI
|
||||
* EN 300 468 and ARIB STD-B10) or {@code program_number} (which usually has the same value
|
||||
* as {@code service_id}) in ISO/IEC 13818-1 if the channel is transmitted via the MPEG
|
||||
* Transport Stream.
|
||||
* </p><p>
|
||||
* This is a required field if the current channel is transmitted via the MPEG Transport
|
||||
* Stream.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String COLUMN_SERVICE_ID = "service_id";
|
||||
|
||||
/**
|
||||
* The channel number that is displayed to the user.
|
||||
* <p>
|
||||
* The format can vary depending on broadcast standard and product specification.
|
||||
* </p><p>
|
||||
* Type: INTEGER
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String DISPLAY_NUMBER = "display_number";
|
||||
public static final String COLUMN_DISPLAY_NUMBER = "display_number";
|
||||
|
||||
/**
|
||||
* The channel name that is displayed to the user.
|
||||
@@ -369,7 +445,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String DISPLAY_NAME = "display_name";
|
||||
public static final String COLUMN_DISPLAY_NAME = "display_name";
|
||||
|
||||
/**
|
||||
* The description of this TV channel.
|
||||
@@ -379,7 +455,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String COLUMN_DESCRIPTION = "description";
|
||||
|
||||
/**
|
||||
* The flag indicating whether this TV channel is browsable or not.
|
||||
@@ -391,7 +467,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (boolean)
|
||||
* </p>
|
||||
*/
|
||||
public static final String BROWSABLE = "browsable";
|
||||
public static final String COLUMN_BROWSABLE = "browsable";
|
||||
|
||||
/**
|
||||
* Generic data used by individual TV input services.
|
||||
@@ -399,7 +475,7 @@ public final class TvContract {
|
||||
* Type: BLOB
|
||||
* </p>
|
||||
*/
|
||||
public static final String DATA = "data";
|
||||
public static final String COLUMN_DATA = "data";
|
||||
|
||||
|
||||
/**
|
||||
@@ -413,7 +489,7 @@ public final class TvContract {
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String VERSION_NUMBER = "version_number";
|
||||
public static final String COLUMN_VERSION_NUMBER = "version_number";
|
||||
|
||||
private Channels() {}
|
||||
}
|
||||
@@ -441,7 +517,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String CHANNEL_ID = "channel_id";
|
||||
public static final String COLUMN_CHANNEL_ID = "channel_id";
|
||||
|
||||
/**
|
||||
* The title of this TV program.
|
||||
@@ -449,7 +525,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
**/
|
||||
public static final String TITLE = "title";
|
||||
public static final String COLUMN_TITLE = "title";
|
||||
|
||||
/**
|
||||
* The start time of this TV program, in milliseconds since the epoch.
|
||||
@@ -457,7 +533,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String START_TIME_UTC_MILLIS = "start_time_utc_millis";
|
||||
public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The end time of this TV program, in milliseconds since the epoch.
|
||||
@@ -465,7 +541,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String END_TIME_UTC_MILLIS = "end_time_utc_millis";
|
||||
public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The description of this TV program that is displayed to the user by default.
|
||||
@@ -475,19 +551,19 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String COLUMN_DESCRIPTION = "description";
|
||||
|
||||
/**
|
||||
* The detailed, lengthy description of this TV program that is displayed only when the user
|
||||
* wants to see more information.
|
||||
* <p>
|
||||
* TV input services should leave this field empty if they have no additional
|
||||
* details beyond {@link #DESCRIPTION}.
|
||||
* details beyond {@link #COLUMN_DESCRIPTION}.
|
||||
* </p><p>
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String LONG_DESCRIPTION = "long_description";
|
||||
public static final String COLUMN_LONG_DESCRIPTION = "long_description";
|
||||
|
||||
/**
|
||||
* Generic data used by TV input services.
|
||||
@@ -495,7 +571,7 @@ public final class TvContract {
|
||||
* Type: BLOB
|
||||
* </p>
|
||||
*/
|
||||
public static final String DATA = "data";
|
||||
public static final String COLUMN_DATA = "data";
|
||||
|
||||
/**
|
||||
* The version number of this row entry used by TV input services.
|
||||
@@ -508,7 +584,7 @@ public final class TvContract {
|
||||
* Type: INTEGER
|
||||
* </p>
|
||||
*/
|
||||
public static final String VERSION_NUMBER = "version_number";
|
||||
public static final String COLUMN_VERSION_NUMBER = "version_number";
|
||||
|
||||
private Programs() {}
|
||||
}
|
||||
@@ -540,7 +616,8 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String WATCH_START_TIME_UTC_MILLIS = "watch_start_time_utc_millis";
|
||||
public static final String COLUMN_WATCH_START_TIME_UTC_MILLIS =
|
||||
"watch_start_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The UTC time that the user stopped watching this TV program, in milliseconds since the
|
||||
@@ -549,7 +626,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String WATCH_END_TIME_UTC_MILLIS = "watch_end_time_utc_millis";
|
||||
public static final String COLUMN_WATCH_END_TIME_UTC_MILLIS = "watch_end_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The channel ID that contains this TV program.
|
||||
@@ -557,7 +634,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String CHANNEL_ID = "channel_id";
|
||||
public static final String COLUMN_CHANNEL_ID = "channel_id";
|
||||
|
||||
/**
|
||||
* The title of this TV program.
|
||||
@@ -565,7 +642,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String TITLE = "title";
|
||||
public static final String COLUMN_TITLE = "title";
|
||||
|
||||
/**
|
||||
* The start time of this TV program, in milliseconds since the epoch.
|
||||
@@ -573,7 +650,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String START_TIME_UTC_MILLIS = "start_time_utc_millis";
|
||||
public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The end time of this TV program, in milliseconds since the epoch.
|
||||
@@ -581,7 +658,7 @@ public final class TvContract {
|
||||
* Type: INTEGER (long)
|
||||
* </p>
|
||||
*/
|
||||
public static final String END_TIME_UTC_MILLIS = "end_time_utc_millis";
|
||||
public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
|
||||
|
||||
/**
|
||||
* The description of this TV program.
|
||||
@@ -589,7 +666,7 @@ public final class TvContract {
|
||||
* Type: TEXT
|
||||
* </p>
|
||||
*/
|
||||
public static final String DESCRIPTION = "description";
|
||||
public static final String COLUMN_DESCRIPTION = "description";
|
||||
|
||||
private WatchedPrograms() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user