Most visited

Recently visited

Added in API level 21

TvContract

public final class TvContract
extends Object

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


电视供应商与应用程序之间的合同。 包含支持的URI和列的定义。

概述

TvContract定义了电视内容元数据的基本数据库,例如频道和节目信息。 信息存储在TvContract.ChannelsTvContract.Programs表中。

Summary

Nested classes

interface TvContract.BaseTvColumns

电视频道/节目表的通用基础。

class TvContract.Channels

电视频道表的列定义。

class TvContract.Programs

电视节目表的列定义。

class TvContract.RecordedPrograms

录制的电视节目表的列定义。

Constants

String AUTHORITY

电视供应商的权力。

Public methods

static final Uri buildChannelLogoUri(Uri channelUri)

构建指向频道徽标的URI。

static final Uri buildChannelLogoUri(long channelId)

构建指向频道徽标的URI。

static final Uri buildChannelUri(long channelId)

构建指向特定频道的URI。

static final Uri buildChannelUriForPassthroughInput(String inputId)

构建一个专门用于传递输入的通道URI。

static final Uri buildChannelsUriForInput(String inputId)

构建指向给定电视输入的所有频道的URI。

static final String buildInputId(ComponentName name)

构建唯一标识电视输入服务的标识。

static final Uri buildProgramUri(long programId)

构建指向特定程序的URI。

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

构建指向特定频道上节目与给定时间范围重叠的节目的URI。

static final Uri buildProgramsUriForChannel(long channelId)

构建指向给定频道上所有节目的URI。

static final Uri buildProgramsUriForChannel(Uri channelUri)

构建指向给定频道上所有节目的URI。

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

构建指向特定频道上节目与给定时间范围重叠的节目的URI。

static final Uri buildRecordedProgramUri(long recordedProgramId)

构建指向特定录制节目的URI。

static final boolean isChannelUri(Uri uri)

如果 uri是通道URI,则返回 true

static final boolean isChannelUriForPassthroughInput(Uri uri)

如果 uri是传递输入的通道URI,则返回 true

static final boolean isChannelUriForTunerInput(Uri uri)

如果 uri是调谐器输入的通道URI,则返回 true

static final boolean isProgramUri(Uri uri)

如果 uri是程序URI,则返回 true

Inherited methods

From class java.lang.Object

Constants

AUTHORITY

Added in API level 21
String AUTHORITY

电视供应商的权力。

常量值:“android.media.tv”

Public methods

buildChannelLogoUri

Added in API level 21
Uri buildChannelLogoUri (Uri channelUri)

构建指向频道徽标的URI。 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)

构建指向频道徽标的URI。 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)

构建指向特定频道的URI。

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

buildChannelUriForPassthroughInput

Added in API level 21
Uri buildChannelUriForPassthroughInput (String inputId)

构建一个专门用于传递输入的通道URI。 (例如HDMI)

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

也可以看看:

buildChannelsUriForInput

Added in API level 21
Uri buildChannelsUriForInput (String inputId)

构建指向给定电视输入的所有频道的URI。

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)

构建唯一标识电视输入服务的标识。

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)

构建指向特定程序的URI。

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)

构建指向特定频道上节目与给定时间范围重叠的节目的URI。

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)

构建指向给定频道上所有节目的URI。

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

buildProgramsUriForChannel

Added in API level 21
Uri buildProgramsUriForChannel (Uri channelUri)

构建指向给定频道上所有节目的URI。

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)

构建指向特定频道上节目与给定时间范围重叠的节目的URI。

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)

构建指向特定录制节目的URI。

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

isChannelUri

Added in API level 24
boolean isChannelUri (Uri uri)

如果 uri是通道URI,则返回 true

Parameters
uri Uri
Returns
boolean

isChannelUriForPassthroughInput

Added in API level 24
boolean isChannelUriForPassthroughInput (Uri uri)

如果 uri是传递输入的通道URI,则返回 true

Parameters
uri Uri
Returns
boolean

isChannelUriForTunerInput

Added in API level 24
boolean isChannelUriForTunerInput (Uri uri)

如果 uri是调谐器输入的通道URI,则返回 true

Parameters
uri Uri
Returns
boolean

isProgramUri

Added in API level 24
boolean isProgramUri (Uri uri)

如果 uri是程序URI,则返回 true

Parameters
uri Uri
Returns
boolean

Hooray!