Most visited

Recently visited

Added in API level 21

TvContract

public final class TvContract
extends Object

java.lang.Object
   ↳ android.media.tv.TvContract


The contract between the TV provider and applications. Contains definitions for the supported URIs and columns.

Overview

TvContract defines a basic database of TV content metadata such as channel and program information. The information is stored in TvContract.Channels and TvContract.Programs tables.

Summary

Nested classes

interface TvContract.BaseTvColumns

Common base for the tables of TV channels/programs. 

class TvContract.Channels

Column definitions for the TV channels table. 

class TvContract.Programs

Column definitions for the TV programs table. 

class TvContract.RecordedPrograms

Column definitions for the recorded TV programs table. 

Constants

String AUTHORITY

The authority for the TV provider.

Public methods

static final Uri buildChannelLogoUri(Uri channelUri)

Builds a URI that points to a channel logo.

static final Uri buildChannelLogoUri(long channelId)

Builds a URI that points to a channel logo.

static final Uri buildChannelUri(long channelId)

Builds a URI that points to a specific channel.

static final Uri buildChannelUriForPassthroughInput(String inputId)

Build a special channel URI intended to be used with pass-through inputs.

static final Uri buildChannelsUriForInput(String inputId)

Builds a URI that points to all channels from a given TV input.

static final String buildInputId(ComponentName name)

Builds an ID that uniquely identifies a TV input service.

static final Uri buildProgramUri(long programId)

Builds a URI that points to a specific program.

static final Uri buildProgramsUriForChannel(long channelId, long startTime, long endTime)

Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.

static final Uri buildProgramsUriForChannel(long channelId)

Builds a URI that points to all programs on a given channel.

static final Uri buildProgramsUriForChannel(Uri channelUri)

Builds a URI that points to all programs on a given channel.

static final Uri buildProgramsUriForChannel(Uri channelUri, long startTime, long endTime)

Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.

static final Uri buildRecordedProgramUri(long recordedProgramId)

Builds a URI that points to a specific recorded program.

static final boolean isChannelUri(Uri uri)

Returns true, if uri is a channel URI.

static final boolean isChannelUriForPassthroughInput(Uri uri)

Returns true, if uri is a channel URI for a pass-through input.

static final boolean isChannelUriForTunerInput(Uri uri)

Returns true, if uri is a channel URI for a tuner input.

static final boolean isProgramUri(Uri uri)

Returns true, if uri is a program URI.

Inherited methods

From class java.lang.Object

Constants

AUTHORITY

Added in API level 21
String AUTHORITY

The authority for the TV provider.

Constant Value: "android.media.tv"

Public methods

buildChannelLogoUri

Added in API level 21
Uri buildChannelLogoUri (Uri channelUri)

Builds a URI that points to a channel logo. See TvContract.Channels.Logo.

Parameters
channelUri Uri: The URI of the channel whose logo is pointed to.
Returns
Uri

buildChannelLogoUri

Added in API level 21
Uri buildChannelLogoUri (long channelId)

Builds a URI that points to a channel logo. See TvContract.Channels.Logo.

Parameters
channelId long: The ID of the channel whose logo is pointed to.
Returns
Uri

buildChannelUri

Added in API level 21
Uri buildChannelUri (long channelId)

Builds a URI that points to a specific channel.

Parameters
channelId long: The ID of the channel to point to.
Returns
Uri

buildChannelUriForPassthroughInput

Added in API level 21
Uri buildChannelUriForPassthroughInput (String inputId)

Build a special channel URI intended to be used with pass-through inputs. (e.g. HDMI)

Parameters
inputId String: The ID of the pass-through input to build a channels URI for.
Returns
Uri

See also:

buildChannelsUriForInput

Added in API level 21
Uri buildChannelsUriForInput (String inputId)

Builds a URI that points to all channels from a given TV input.

Parameters
inputId String: The ID of the TV input to build a channels URI for. If null, builds a URI for all the TV inputs.
Returns
Uri

buildInputId

Added in API level 21
String buildInputId (ComponentName name)

Builds an ID that uniquely identifies a TV input service.

Parameters
name ComponentName: The ComponentName of the TV input service to build ID for.
Returns
String the ID for the given TV input service.

buildProgramUri

Added in API level 21
Uri buildProgramUri (long programId)

Builds a URI that points to a specific program.

Parameters
programId long: The ID of the program to point to.
Returns
Uri

buildProgramsUriForChannel

Added in API level 21
Uri buildProgramsUriForChannel (long channelId, 
                long startTime, 
                long endTime)

Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.

Parameters
channelId long: The ID of the channel to return programs for.
startTime long: The start time used to filter programs. The returned programs should have COLUMN_END_TIME_UTC_MILLIS that is greater than this time.
endTime long: The end time used to filter programs. The returned programs should have COLUMN_START_TIME_UTC_MILLIS that is less than this time.
Returns
Uri

buildProgramsUriForChannel

Added in API level 21
Uri buildProgramsUriForChannel (long channelId)

Builds a URI that points to all programs on a given channel.

Parameters
channelId long: The ID of the channel to return programs for.
Returns
Uri

buildProgramsUriForChannel

Added in API level 21
Uri buildProgramsUriForChannel (Uri channelUri)

Builds a URI that points to all programs on a given channel.

Parameters
channelUri Uri: The URI of the channel to return programs for.
Returns
Uri

buildProgramsUriForChannel

Added in API level 21
Uri buildProgramsUriForChannel (Uri channelUri, 
                long startTime, 
                long endTime)

Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame.

Parameters
channelUri Uri: The URI of the channel to return programs for.
startTime long: The start time used to filter programs. The returned programs should have COLUMN_END_TIME_UTC_MILLIS that is greater than this time.
endTime long: The end time used to filter programs. The returned programs should have COLUMN_START_TIME_UTC_MILLIS that is less than this time.
Returns
Uri

buildRecordedProgramUri

Added in API level 24
Uri buildRecordedProgramUri (long recordedProgramId)

Builds a URI that points to a specific recorded program.

Parameters
recordedProgramId long: The ID of the recorded program to point to.
Returns
Uri

isChannelUri

Added in API level 24
boolean isChannelUri (Uri uri)

Returns true, if uri is a channel URI.

Parameters
uri Uri
Returns
boolean

isChannelUriForPassthroughInput

Added in API level 24
boolean isChannelUriForPassthroughInput (Uri uri)

Returns true, if uri is a channel URI for a pass-through input.

Parameters
uri Uri
Returns
boolean

isChannelUriForTunerInput

Added in API level 24
boolean isChannelUriForTunerInput (Uri uri)

Returns true, if uri is a channel URI for a tuner input.

Parameters
uri Uri
Returns
boolean

isProgramUri

Added in API level 24
boolean isProgramUri (Uri uri)

Returns true, if uri is a program URI.

Parameters
uri Uri
Returns
boolean

Hooray!