# TvContract

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/media/tv/TvContract#nestedclasses)\|[Constants](https://developer.android.com/reference/android/media/tv/TvContract#constants)\|[Methods](https://developer.android.com/reference/android/media/tv/TvContract#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/tv/TvContract#inhmethods)  

# TvContract

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/tv/TvContract "View this page in Kotlin")\|Java

`
public

final

class
TvContract
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|-----------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.tv.TvContract |

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

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

<br />

## Summary

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

|                                                                                                                                                                                                                                       ### Constants                                                                                                                                                                                                                                       ||
|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_INITIALIZE_PROGRAMS](https://developer.android.com/reference/android/media/tv/TvContract#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](https://developer.android.com/reference/java/lang/String) | [ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT](https://developer.android.com/reference/android/media/tv/TvContract#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](https://developer.android.com/reference/java/lang/String) | [ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED](https://developer.android.com/reference/android/media/tv/TvContract#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](https://developer.android.com/reference/java/lang/String) | [ACTION_REQUEST_CHANNEL_BROWSABLE](https://developer.android.com/reference/android/media/tv/TvContract#ACTION_REQUEST_CHANNEL_BROWSABLE) Activity Action: sent by an application telling the system to make the given channel browsable with user interaction.                                                                                                                                                        |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED](https://developer.android.com/reference/android/media/tv/TvContract#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](https://developer.android.com/reference/java/lang/String) | [AUTHORITY](https://developer.android.com/reference/android/media/tv/TvContract#AUTHORITY) The authority for the TV provider.                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_CHANNEL_ID](https://developer.android.com/reference/android/media/tv/TvContract#EXTRA_CHANNEL_ID) The key for a bundle parameter containing a channel ID as a long integer                                                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_PREVIEW_PROGRAM_ID](https://developer.android.com/reference/android/media/tv/TvContract#EXTRA_PREVIEW_PROGRAM_ID) The key for a bundle parameter containing a program ID as a long integer.                                                                                                                                                                                                                    |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_WATCH_NEXT_PROGRAM_ID](https://developer.android.com/reference/android/media/tv/TvContract#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)     | ` `[buildChannelLogoUri](https://developer.android.com/reference/android/media/tv/TvContract#buildChannelLogoUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` channelUri) ` Builds a URI that points to a channel logo.                                                                                                                               |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildChannelLogoUri](https://developer.android.com/reference/android/media/tv/TvContract#buildChannelLogoUri(long))`(long channelId) ` Builds a URI that points to a channel logo.                                                                                                                                                                                                       |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildChannelUri](https://developer.android.com/reference/android/media/tv/TvContract#buildChannelUri(long))`(long channelId) ` Builds a URI that points to a specific channel.                                                                                                                                                                                                           |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildChannelUriForPassthroughInput](https://developer.android.com/reference/android/media/tv/TvContract#buildChannelUriForPassthroughInput(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/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)     | ` `[buildChannelsUriForInput](https://developer.android.com/reference/android/media/tv/TvContract#buildChannelsUriForInput(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` inputId) ` Builds a URI that points to all channels from a given TV input.                                                                                               |
| ` static `[String](https://developer.android.com/reference/java/lang/String) | ` `[buildInputId](https://developer.android.com/reference/android/media/tv/TvContract#buildInputId(android.content.ComponentName))`(`[ComponentName](https://developer.android.com/reference/android/content/ComponentName)` name) ` Builds an ID that uniquely identifies a TV input service.                                                                                               |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildPreviewProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#buildPreviewProgramUri(long))`(long previewProgramId) ` Builds a URI that points to a specific preview program.                                                                                                                                                                              |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildPreviewProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#buildPreviewProgramsUriForChannel(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` channelUri) ` Builds a URI that points to all preview programs on a given channel.                                                                          |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildPreviewProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#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)     | ` `[buildProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#buildProgramUri(long))`(long programId) ` Builds a URI that points to a specific program.                                                                                                                                                                                                           |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#buildProgramsUriForChannel(long,%20long,%20long))`(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)     | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#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)     | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#buildProgramsUriForChannel(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` channelUri) ` Builds a URI that points to all programs on a given channel.                                                                                                |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildProgramsUriForChannel](https://developer.android.com/reference/android/media/tv/TvContract#buildProgramsUriForChannel(android.net.Uri,%20long,%20long))`(`[Uri](https://developer.android.com/reference/android/net/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 `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildRecordedProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#buildRecordedProgramUri(long))`(long recordedProgramId) ` Builds a URI that points to a specific recorded program.                                                                                                                                                                          |
| ` static `[Uri](https://developer.android.com/reference/android/net/Uri)     | ` `[buildWatchNextProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#buildWatchNextProgramUri(long))`(long watchNextProgramId) ` Builds a URI that points to a specific watch next program.                                                                                                                                                                     |
| ` static boolean`                                                            | ` `[isChannelUri](https://developer.android.com/reference/android/media/tv/TvContract#isChannelUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) `                                                                                                                                                                                                |
| ` static boolean`                                                            | ` `[isChannelUriForPassthroughInput](https://developer.android.com/reference/android/media/tv/TvContract#isChannelUriForPassthroughInput(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) `                                                                                                                                                          |
| ` static boolean`                                                            | ` `[isChannelUriForTunerInput](https://developer.android.com/reference/android/media/tv/TvContract#isChannelUriForTunerInput(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) `                                                                                                                                                                      |
| ` static boolean`                                                            | ` `[isProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#isProgramUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) `                                                                                                                                                                                                |
| ` static boolean`                                                            | ` `[isRecordedProgramUri](https://developer.android.com/reference/android/media/tv/TvContract#isRecordedProgramUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) `                                                                                                                                                                                |
| ` static void`                                                               | ` `[requestChannelBrowsable](https://developer.android.com/reference/android/media/tv/TvContract#requestChannelBrowsable(android.content.Context,%20long))`(`[Context](https://developer.android.com/reference/android/content/Context)` context, long channelId) ` Requests to make a channel browsable.                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ACTION_INITIALIZE_PROGRAMS

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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[PackageManager.FEATURE_LEANBACK](https://developer.android.com/reference/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`.

<br />

<br />

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

### ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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/media/tv/TvContract#EXTRA_PREVIEW_PROGRAM_ID): the ID of the existing preview program.
- [EXTRA_WATCH_NEXT_PROGRAM_ID](https://developer.android.com/reference/android/media/tv/TvContract#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[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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/media/tv/TvContract#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[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

The intent must contain the following bundle parameters:

- [EXTRA_CHANNEL_ID](https://developer.android.com/reference/android/media/tv/TvContract#EXTRA_CHANNEL_ID): ID for the[Channels.TYPE_PREVIEW](https://developer.android.com/reference/android/media/tv/TvContract.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[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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/media/tv/TvContract#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[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String AUTHORITY
```

The authority for the TV provider.

<br />

Constant Value: "android.media.tv"  

### EXTRA_CHANNEL_ID

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final 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[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static Uri buildChannelLogoUri (Uri channelUri)
```

Builds a URI that points to a channel logo. See[Channels.Logo](https://developer.android.com/reference/android/media/tv/TvContract.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) | <br /> |

### buildChannelLogoUri

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static Uri buildChannelLogoUri (long channelId)
```

Builds a URI that points to a channel logo. See[Channels.Logo](https://developer.android.com/reference/android/media/tv/TvContract.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) | <br /> |

### buildChannelUri

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildChannelUriForPassthroughInput

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

**See also:**

- [TvInputInfo.isPassthroughInput()](https://developer.android.com/reference/android/media/tv/TvInputInfo#isPassthroughInput())  

### buildChannelsUriForInput

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildInputId

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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)of the TV input service to build ID for. <br /> |

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the ID for the given TV input service. <br /> |

### buildPreviewProgramUri

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildPreviewProgramsUriForChannel

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildPreviewProgramsUriForChannel

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildProgramUri

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildProgramsUriForChannel

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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 will have a[Programs.COLUMN_END_TIME_UTC_MILLIS](https://developer.android.com/reference/android/media/tv/TvContract.Programs#COLUMN_END_TIME_UTC_MILLIS)that is greater than or equal to`startTime`. <br /> |
| `endTime`   | `long`: The end time used to filter programs. The returned programs will have[Programs.COLUMN_START_TIME_UTC_MILLIS](https://developer.android.com/reference/android/media/tv/TvContract.Programs#COLUMN_START_TIME_UTC_MILLIS)that is less than or equal to`endTime`. <br />      |

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

### buildProgramsUriForChannel

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildProgramsUriForChannel

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildProgramsUriForChannel

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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[Programs.COLUMN_END_TIME_UTC_MILLIS](https://developer.android.com/reference/android/media/tv/TvContract.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[Programs.COLUMN_START_TIME_UTC_MILLIS](https://developer.android.com/reference/android/media/tv/TvContract.Programs#COLUMN_START_TIME_UTC_MILLIS)that is less than this time. <br />  |

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

### buildRecordedProgramUri

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### buildWatchNextProgramUri

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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) | <br /> |

### isChannelUri

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isChannelUri (Uri uri)
```

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                     Returns                      ||
|-----------|---------------------------------------|
| `boolean` | `true`if`uri`is a channel URI. <br /> |

### isChannelUriForPassthroughInput

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isChannelUriForPassthroughInput (Uri uri)
```

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                                  Returns                                  ||
|-----------|----------------------------------------------------------------|
| `boolean` | `true`if`uri`is a channel URI for a pass-through input. <br /> |

### isChannelUriForTunerInput

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isChannelUriForTunerInput (Uri uri)
```

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                              Returns                               ||
|-----------|---------------------------------------------------------|
| `boolean` | `true`if`uri`is a channel URI for a tuner input. <br /> |

### isProgramUri

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isProgramUri (Uri uri)
```

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                     Returns                      ||
|-----------|---------------------------------------|
| `boolean` | `true`if`uri`is a program URI. <br /> |

### isRecordedProgramUri

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static boolean isRecordedProgramUri (Uri uri)
```

<br />

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                          Returns                          ||
|-----------|------------------------------------------------|
| `boolean` | `true`if`uri`is a recorded program URI. <br /> |

### requestChannelBrowsable

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static 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[Channels.TYPE_PREVIEW](https://developer.android.com/reference/android/media/tv/TvContract.Channels#TYPE_PREVIEW)type.

<br />

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

**See also:**

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