TvContractCompat
class TvContractCompat
kotlin.Any | |
↳ | androidx.tvprovider.media.tv.TvContractCompat |
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 Channels
and Programs
tables.
- A row in the
Channels
table represents information about a TV channel. The data format can vary greatly from standard to standard or according to service provider, thus the columns here are mostly comprised of basic entities that are usually seen to users regardless of standard such as channel number and name. - A row in the
Programs
table represents a set of data describing a TV program such as program title and start time.
Summary
Nested classes | |
---|---|
abstract |
Common base for the tables of TV channels/programs. |
Column definitions for the TV channels table. |
|
Column definitions for the preview TV programs table. |
|
Column definitions for the TV programs table. |
|
Column definitions for the recorded TV programs table. |
|
Column definitions for the "watch next" TV programs table. |
Constants | |
---|---|
static String |
Broadcast Action: sent to the target TV input after it is first installed to notify the input to initialize its channels and programs to the system content provider. |
static String |
Broadcast Action: sent by the system to tell the target TV input that one of its existing preview programs is added to the watch next programs table by user. |
static String |
Broadcast Action: sent by the system to tell the target TV input that one of its preview program's browsable state is disabled, i. |
static String |
Activity Action: sent by an application telling the system to make the given channel browsable with user interaction. |
static String |
Broadcast Action: sent by the system to tell the target TV input that one of its "watch next" program's browsable state is disabled, i. |
static String |
The authority for the TV provider. |
static String |
The key for a bundle parameter containing a channel ID as a long integer |
static String |
The key for a bundle parameter containing a program ID as a long integer. |
static String |
The key for a bundle parameter containing a watch next program ID as a long integer. |
Public methods | |
---|---|
static Uri! |
buildChannelLogoUri(channelId: Long) Builds a URI that points to a channel logo. |
static Uri! |
buildChannelLogoUri(channelUri: Uri!) Builds a URI that points to a channel logo. |
static Uri! |
buildChannelUri(channelId: Long) Builds a URI that points to a specific channel. |
static Uri! |
buildChannelUriForPassthroughInput(inputId: String!) Build a special channel URI intended to be used with pass-through inputs. |
static Uri! |
buildChannelsUriForInput(@Nullable inputId: String?) Builds a URI that points to all channels from a given TV input. |
static String! |
buildInputId(name: ComponentName!) Builds an ID that uniquely identifies a TV input service. |
static Uri! |
buildPreviewProgramUri(previewProgramId: Long) Builds a URI that points to a specific preview program. |
static Uri! |
buildPreviewProgramsUriForChannel(channelId: Long) Builds a URI that points to all preview programs on a given channel. |
static Uri! |
buildPreviewProgramsUriForChannel(channelUri: Uri!) Builds a URI that points to all preview programs on a given channel. |
static Uri! |
buildProgramUri(programId: Long) Builds a URI that points to a specific program. |
static Uri! |
buildProgramsUriForChannel(channelId: Long) Builds a URI that points to all programs on a given channel. |
static Uri! |
buildProgramsUriForChannel(channelUri: Uri!) Builds a URI that points to all programs on a given channel. |
static Uri! |
buildProgramsUriForChannel(channelId: Long, startTime: Long, endTime: Long) Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame. |
static Uri! |
buildProgramsUriForChannel(channelUri: Uri!, startTime: Long, endTime: Long) Builds a URI that points to programs on a specific channel whose schedules overlap with the given time frame. |
static Uri! |
buildRecordedProgramUri(recordedProgramId: Long) Builds a URI that points to a specific recorded program. |
static Uri! |
buildWatchNextProgramUri(watchNextProgramId: Long) Builds a URI that points to a specific watch next program. |
static Boolean |
isChannelUri(uri: Uri!) Returns |
static Boolean |
Returns |
static Boolean |
isChannelUriForTunerInput(uri: Uri!) Returns |
static Boolean |
isProgramUri(uri: Uri!) Returns |
static Boolean |
isRecordedProgramUri(uri: Uri!) Returns |
static Unit |
requestChannelBrowsable(context: Context!, channelId: Long) Requests to make a channel browsable. |
Constants
ACTION_INITIALIZE_PROGRAMS
static val ACTION_INITIALIZE_PROGRAMS: String
Broadcast Action: sent to the target TV input after it is first installed to notify the input to initialize its channels and programs to the system content provider.
Note that this intent is sent only on devices with android.content.pm.PackageManager#FEATURE_LEANBACK
enabled. Besides that, in order to receive this intent, the target TV input must:
- Declare a broadcast receiver for this intent in its
AndroidManifest.xml
. - Declare appropriate permissions to write channel and program data in its
AndroidManifest.xml
.
Value: "android.media.tv.action.INITIALIZE_PROGRAMS"
ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT
static val ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT: String
Broadcast Action: sent by the system to tell the target TV input that one of its existing preview programs is added to the watch next programs table by user.
The intent must contain the following bundle parameters:
EXTRA_PREVIEW_PROGRAM_ID
: the ID of the existing preview program.EXTRA_WATCH_NEXT_PROGRAM_ID
: the ID of the new watch next program.
Value: "android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT"
ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED
static val ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED: String
Broadcast Action: sent by the system to tell the target TV input that one of its preview program's browsable state is disabled, i.e., it will no longer be shown to users, which, for example, might be a result of users' interaction with UI. The input is expected to delete the preview program from the content provider.
The intent must contain the following bundle parameter:
EXTRA_PREVIEW_PROGRAM_ID
: the disabled preview program ID.
Value: "android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED"
ACTION_REQUEST_CHANNEL_BROWSABLE
static val ACTION_REQUEST_CHANNEL_BROWSABLE: String
Activity Action: sent by an application telling the system to make the given channel browsable with user interaction. The system may show UI to ask user to approve the channel. This is only relevant to channels with Channels#TYPE_PREVIEW
type. Use Activity#startActivityForResult to get the result of the request.
The intent must contain the following bundle parameters:
EXTRA_CHANNEL_ID
: ID for theChannels#TYPE_PREVIEW
channel as a long integer.
Value: "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE"
ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED
static val ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED: String
Broadcast Action: sent by the system to tell the target TV input that one of its "watch next" program's browsable state is disabled, i.e., it will no longer be shown to users, which, for example, might be a result of users' interaction with UI. The input is expected to delete the "watch next" program from the content provider.
The intent must contain the following bundle parameter:
EXTRA_WATCH_NEXT_PROGRAM_ID
: the disabled "watch next" program ID.
Value: "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED"
EXTRA_CHANNEL_ID
static val EXTRA_CHANNEL_ID: String
The key for a bundle parameter containing a channel ID as a long integer
Value: "android.media.tv.extra.CHANNEL_ID"
EXTRA_PREVIEW_PROGRAM_ID
static val EXTRA_PREVIEW_PROGRAM_ID: String
The key for a bundle parameter containing a program ID as a long integer.
Value: "android.media.tv.extra.PREVIEW_PROGRAM_ID"
EXTRA_WATCH_NEXT_PROGRAM_ID
static val EXTRA_WATCH_NEXT_PROGRAM_ID: String
The key for a bundle parameter containing a watch next program ID as a long integer.
Value: "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID"
Public methods
buildChannelLogoUri
static fun buildChannelLogoUri(channelId: Long): Uri!
Builds a URI that points to a channel logo. See Channels.Logo
.
Parameters | |
---|---|
channelId |
Long: The ID of the channel whose logo is pointed to. |
buildChannelLogoUri
static fun buildChannelLogoUri(channelUri: Uri!):