# TvContractCompat

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#nestedclasses)\|[Constants](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#constants)\|[Methods](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#)  

# TvContractCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
TvContractCompat
`  
`

extends Object


``


`

|---|-------------------------------------------|
| java.lang.Object                             ||
| ↳ | android.support.media.tv.TvContractCompat |

<br />

*** ** * ** ***

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[TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels)and[TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs)tables.

- A row in the[TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.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[TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs)table represents a set of data describing a TV program such as program title and start time.

<br />

## Summary

|                                                                                                 ### Nested classes                                                                                                 ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [TvContractCompat.BaseTvColumns](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.BaseTvColumns) Common base for the tables of TV channels/programs.                |
| ` class`     | [TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels) Column definitions for the TV channels table.                                |
| ` class`     | [TvContractCompat.PreviewPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.PreviewPrograms) Column definitions for the preview TV programs table.          |
| ` class`     | [TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs) Column definitions for the TV programs table.                                |
| ` class`     | [TvContractCompat.RecordedPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.RecordedPrograms) Column definitions for the recorded TV programs table.       |
| ` class`     | [TvContractCompat.WatchNextPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.WatchNextPrograms) Column definitions for the "watch next" TV programs table. |

|                                                                                                                                                                                                                 ### Constants                                                                                                                                                                                                                 ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | [ACTION_INITIALIZE_PROGRAMS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#ACTION_INITIALIZE_PROGRAMS) 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.                                                                                                                    |
| `String` | [ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT) 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.                                                                                            |
| `String` | [ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED) 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.            |
| `String` | [ACTION_REQUEST_CHANNEL_BROWSABLE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#ACTION_REQUEST_CHANNEL_BROWSABLE) Activity Action: sent by an application telling the system to make the given channel browsable with user interaction.                                                                                                                                                        |
| `String` | [ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED) 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. |
| `String` | [AUTHORITY](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#AUTHORITY) The authority for the TV provider.                                                                                                                                                                                                                                                                                         |
| `String` | [EXTRA_CHANNEL_ID](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_CHANNEL_ID) The key for a bundle parameter containing a channel ID as a long integer                                                                                                                                                                                                                                     |
| `String` | [EXTRA_PREVIEW_PROGRAM_ID](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_PREVIEW_PROGRAM_ID) The key for a bundle parameter containing a program ID as a long integer.                                                                                                                                                                                                                    |
| `String` | [EXTRA_WATCH_NEXT_PROGRAM_ID](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_WATCH_NEXT_PROGRAM_ID) The key for a bundle parameter containing a watch next program ID as a long integer.                                                                                                                                                                                                   |

|                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                     ||
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildChannelLogoUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildChannelLogoUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` channelUri) ` Builds a URI that points to a channel logo.                                                                                                                           |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildChannelLogoUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildChannelLogoUri(long))`(long channelId) ` Builds a URI that points to a channel logo.                                                                                                                                                                                                        |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildChannelUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildChannelUri(long))`(long channelId) ` Builds a URI that points to a specific channel.                                                                                                                                                                                                            |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildChannelUriForPassthroughInput](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildChannelUriForPassthroughInput(java.lang.String))`(String inputId) ` Build a special channel URI intended to be used with pass-through inputs.                                                                                                                                |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildChannelsUriForInput](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildChannelsUriForInput(java.lang.String))`(String inputId) ` Builds a URI that points to all channels from a given TV input.                                                                                                                                                              |
| ` static String`                                                              | ` `[buildInputId](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildInputId(android.content.ComponentName))`(`[ComponentName](https://developer.android.com/reference/android/content/ComponentName.html)` name) ` Builds an ID that uniquely identifies a TV input service.                                                                                           |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildPreviewProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildPreviewProgramUri(long))`(long previewProgramId) ` Builds a URI that points to a specific preview program.                                                                                                                                                                               |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildPreviewProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildPreviewProgramsUriForChannel(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` channelUri) ` Builds a URI that points to all preview programs on a given channel.                                                                      |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildPreviewProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildPreviewProgramsUriForChannel(long))`(long channelId) ` Builds a URI that points to all preview programs on a given channel.                                                                                                                                                   |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildProgramUri(long))`(long programId) ` Builds a URI that points to a specific program.                                                                                                                                                                                                            |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildProgramsUriForChannel(long, long, long))`(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 `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildProgramsUriForChannel(long))`(long channelId) ` Builds a URI that points to all programs on a given channel.                                                                                                                                                                         |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildProgramsUriForChannel(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` channelUri) ` Builds a URI that points to all programs on a given channel.                                                                                            |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildProgramsUriForChannel(android.net.Uri, long, long))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` 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 `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildRecordedProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildRecordedProgramUri(long))`(long recordedProgramId) ` Builds a URI that points to a specific recorded program.                                                                                                                                                                           |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri.html) | ` `[buildWatchNextProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#buildWatchNextProgramUri(long))`(long watchNextProgramId) ` Builds a URI that points to a specific watch next program.                                                                                                                                                                      |
| ` static boolean`                                                             | ` `[isChannelUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#isChannelUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Returns`true`, if`uri`is a channel URI.                                                                                                                                                    |
| ` static boolean`                                                             | ` `[isChannelUriForPassthroughInput](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#isChannelUriForPassthroughInput(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Returns`true`, if`uri`is a channel URI for a pass-through input.                                                                                     |
| ` static boolean`                                                             | ` `[isChannelUriForTunerInput](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#isChannelUriForTunerInput(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Returns`true`, if`uri`is a channel URI for a tuner input.                                                                                                        |
| ` static boolean`                                                             | ` `[isProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#isProgramUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Returns`true`, if`uri`is a program URI.                                                                                                                                                    |
| ` static boolean`                                                             | ` `[isRecordedProgramUri](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#isRecordedProgramUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Returns`true`, if`uri`is a recorded program URI.                                                                                                                           |
| ` static void`                                                                | ` `[requestChannelBrowsable](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#requestChannelBrowsable(android.content.Context, long))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, long channelId) ` Requests to make a channel browsable.                                                                                  |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### ACTION_INITIALIZE_PROGRAMS

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ACTION_INITIALIZE_PROGRAMS
```

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[FEATURE_LEANBACK](https://developer.android.com/reference/android/content/pm/PackageManager.html#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`.

<br />

<br />

Constant Value: "android.media.tv.action.INITIALIZE_PROGRAMS"  

### ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT
```

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](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_PREVIEW_PROGRAM_ID): the ID of the existing preview program.
- [EXTRA_WATCH_NEXT_PROGRAM_ID](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_WATCH_NEXT_PROGRAM_ID): the ID of the new watch next program.

<br />

<br />

Constant Value: "android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT"  

### ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED
```

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](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_PREVIEW_PROGRAM_ID): the disabled preview program ID.

<br />

<br />

Constant Value: "android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED"  

### ACTION_REQUEST_CHANNEL_BROWSABLE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ACTION_REQUEST_CHANNEL_BROWSABLE
```

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[TYPE_PREVIEW](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels#TYPE_PREVIEW)type. Use[startActivityForResult(Intent, int)](https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int))to get the result of the request.

The intent must contain the following bundle parameters:

- [EXTRA_CHANNEL_ID](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_CHANNEL_ID): ID for the[TYPE_PREVIEW](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels#TYPE_PREVIEW)channel as a long integer.

<br />

<br />

Constant Value: "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE"  

### ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED
```

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](https://developer.android.com/reference/android/support/media/tv/TvContractCompat#EXTRA_WATCH_NEXT_PROGRAM_ID): the disabled "watch next" program ID.

<br />

<br />

Constant Value: "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED"  

### AUTHORITY

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String AUTHORITY
```

The authority for the TV provider.

<br />

Constant Value: "android.media.tv"  

### EXTRA_CHANNEL_ID

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String EXTRA_CHANNEL_ID
```

The key for a bundle parameter containing a channel ID as a long integer

<br />

Constant Value: "android.media.tv.extra.CHANNEL_ID"  

### EXTRA_PREVIEW_PROGRAM_ID

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String EXTRA_PREVIEW_PROGRAM_ID
```

The key for a bundle parameter containing a program ID as a long integer.

<br />

Constant Value: "android.media.tv.extra.PREVIEW_PROGRAM_ID"  

### EXTRA_WATCH_NEXT_PROGRAM_ID

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String EXTRA_WATCH_NEXT_PROGRAM_ID
```

The key for a bundle parameter containing a watch next program ID as a long integer.

<br />

Constant Value: "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID"

## Public methods

### buildChannelLogoUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildChannelLogoUri (Uri channelUri)
```

Builds a URI that points to a channel logo. See[TvContractCompat.Channels.Logo](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels.Logo).

<br />

|                                  Parameters                                  ||
|--------------|----------------------------------------------------------------|
| `channelUri` | `Uri`: The URI of the channel whose logo is pointed to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildChannelLogoUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildChannelLogoUri (long channelId)
```

Builds a URI that points to a channel logo. See[TvContractCompat.Channels.Logo](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels.Logo).

<br />

|                                 Parameters                                  ||
|-------------|----------------------------------------------------------------|
| `channelId` | `long`: The ID of the channel whose logo is pointed to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildChannelUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildChannelUri (long channelId)
```

Builds a URI that points to a specific channel.

<br />

|                           Parameters                           ||
|-------------|---------------------------------------------------|
| `channelId` | `long`: The ID of the channel to point to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildChannelUriForPassthroughInput

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildChannelUriForPassthroughInput (String inputId)
```

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

<br />

|                                        Parameters                                         ||
|-----------|--------------------------------------------------------------------------------|
| `inputId` | `String`: The ID of the pass-through input to build a channels URI for. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildChannelsUriForInput

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildChannelsUriForInput (String inputId)
```

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

<br />

|                                                          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. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildInputId

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String buildInputId (ComponentName name)
```

Builds an ID that uniquely identifies a TV input service.

<br />

|                                                                               Parameters                                                                               ||
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `name` | `ComponentName`: The[ComponentName](https://developer.android.com/reference/android/content/ComponentName.html)of the TV input service to build ID for. <br /> |

|                         Returns                         ||
|----------|-----------------------------------------------|
| `String` | the ID for the given TV input service. <br /> |

### buildPreviewProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildPreviewProgramUri (long previewProgramId)
```

Builds a URI that points to a specific preview program.

<br />

|                                  Parameters                                   ||
|--------------------|-----------------------------------------------------------|
| `previewProgramId` | `long`: The ID of the preview program to point to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildPreviewProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildPreviewProgramsUriForChannel (Uri channelUri)
```

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

<br />

|                                     Parameters                                     ||
|--------------|----------------------------------------------------------------------|
| `channelUri` | `Uri`: The URI of the channel to return preview programs for. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildPreviewProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildPreviewProgramsUriForChannel (long channelId)
```

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

<br />

|                                    Parameters                                     ||
|-------------|----------------------------------------------------------------------|
| `channelId` | `long`: The ID of the channel to return preview programs for. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildProgramUri (long programId)
```

Builds a URI that points to a specific program.

<br />

|                           Parameters                           ||
|-------------|---------------------------------------------------|
| `programId` | `long`: The ID of the program to point to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

|                                                                                                                                       Parameters                                                                                                                                        ||
|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `channelId` | `long`: The ID of the channel to return programs for. <br />                                                                                                                                                                                                               |
| `startTime` | `long`: The start time used to filter programs. The returned programs should have[COLUMN_END_TIME_UTC_MILLIS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_END_TIME_UTC_MILLIS)that is greater than this time. <br /> |
| `endTime`   | `long`: The end time used to filter programs. The returned programs should have[COLUMN_START_TIME_UTC_MILLIS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_START_TIME_UTC_MILLIS)that is less than this time. <br />  |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildProgramsUriForChannel (long channelId)
```

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

<br />

|                                Parameters                                 ||
|-------------|--------------------------------------------------------------|
| `channelId` | `long`: The ID of the channel to return programs for. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildProgramsUriForChannel (Uri channelUri)
```

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

<br />

|                                 Parameters                                 ||
|--------------|--------------------------------------------------------------|
| `channelUri` | `Uri`: The URI of the channel to return programs for. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildProgramsUriForChannel

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

|                                                                                                                                        Parameters                                                                                                                                        ||
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `channelUri` | `Uri`: The URI of the channel to return programs for. <br />                                                                                                                                                                                                               |
| `startTime`  | `long`: The start time used to filter programs. The returned programs should have[COLUMN_END_TIME_UTC_MILLIS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_END_TIME_UTC_MILLIS)that is greater than this time. <br /> |
| `endTime`    | `long`: The end time used to filter programs. The returned programs should have[COLUMN_START_TIME_UTC_MILLIS](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs#COLUMN_START_TIME_UTC_MILLIS)that is less than this time. <br />  |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildRecordedProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildRecordedProgramUri (long recordedProgramId)
```

Builds a URI that points to a specific recorded program.

<br />

|                                   Parameters                                    ||
|---------------------|------------------------------------------------------------|
| `recordedProgramId` | `long`: The ID of the recorded program to point to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### buildWatchNextProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Uri buildWatchNextProgramUri (long watchNextProgramId)
```

Builds a URI that points to a specific watch next program.

<br />

|                                     Parameters                                     ||
|----------------------|--------------------------------------------------------------|
| `watchNextProgramId` | `long`: The ID of the watch next program to point to. <br /> |

|                                   Returns                                   ||
|---------------------------------------------------------------------|--------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html) | <br /> |

### isChannelUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isChannelUri (Uri uri)
```

Returns`true`, if`uri`is a channel URI.

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isChannelUriForPassthroughInput

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isChannelUriForPassthroughInput (Uri uri)
```

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

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isChannelUriForTunerInput

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isChannelUriForTunerInput (Uri uri)
```

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

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isProgramUri (Uri uri)
```

Returns`true`, if`uri`is a program URI.

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isRecordedProgramUri

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isRecordedProgramUri (Uri uri)
```

Returns`true`, if`uri`is a recorded program URI.

<br />

|     Parameters      ||
|-------|--------------|
| `uri` | `Uri` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### requestChannelBrowsable

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void requestChannelBrowsable (Context context, 
                long channelId)
```

Requests to make a channel browsable.

Once called, the system will review the request and make the channel browsable based on its policy. The first request from a package is guaranteed to be approved. This is only relevant to channels with[TYPE_PREVIEW](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels#TYPE_PREVIEW)type.

No-op on devices prior to[O](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#O).

<br />

|                                 Parameters                                 ||
|-------------|---------------------------------------------------------------|
| `context`   | `Context`: The context for accessing content provider. <br /> |
| `channelId` | `long`: The channel ID to be browsable. <br />                |

**See also:**

- [COLUMN_BROWSABLE](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels#COLUMN_BROWSABLE)  
-

  ## Interfaces

  - [TvContractCompat.BaseTvColumns](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.BaseTvColumns)
-

  ## Classes

  - [Channel](https://developer.android.com/reference/android/support/media/tv/Channel)
  - [Channel.Builder](https://developer.android.com/reference/android/support/media/tv/Channel.Builder)
  - [ChannelLogoUtils](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils)
  - [PreviewProgram](https://developer.android.com/reference/android/support/media/tv/PreviewProgram)
  - [PreviewProgram.Builder](https://developer.android.com/reference/android/support/media/tv/PreviewProgram.Builder)
  - [Program](https://developer.android.com/reference/android/support/media/tv/Program)
  - [Program.Builder](https://developer.android.com/reference/android/support/media/tv/Program.Builder)
  - [R](https://developer.android.com/reference/android/support/media/tv/R)
  - [R.attr](https://developer.android.com/reference/android/support/media/tv/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/media/tv/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/media/tv/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/media/tv/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/media/tv/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/media/tv/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/media/tv/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/media/tv/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/media/tv/R.string)
  - [R.style](https://developer.android.com/reference/android/support/media/tv/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/media/tv/R.styleable)
  - [TvContractCompat](https://developer.android.com/reference/android/support/media/tv/TvContractCompat)
  - [TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels)
  - [TvContractCompat.Channels.Logo](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels.Logo)
  - [TvContractCompat.PreviewPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.PreviewPrograms)
  - [TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs)
  - [TvContractCompat.Programs.Genres](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres)
  - [TvContractCompat.RecordedPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.RecordedPrograms)
  - [TvContractCompat.WatchNextPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.WatchNextPrograms)
  - [WatchNextProgram](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram)
  - [WatchNextProgram.Builder](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram.Builder)