class Channel


A convenience class to access TvContractCompat.Channels entries in the system content provider.

This class makes it easy to insert or retrieve a channel from the system content provider, which is defined in TvContractCompat.

Usage example when inserting a channel:

Channel channel = new Channel.Builder()
        .setDisplayName("Channel Name")
        .setDescription("Channel description")
        .setType(Channels.TYPE_PREVIEW)
        // Set more attributes...
        .build();
Uri channelUri = getContentResolver().insert(Channels.CONTENT_URI, channel.toContentValues());

Usage example when retrieving a channel:

Channel channel;
try (Cursor cursor = resolver.query(channelUri, null, null, null, null)) {
    if (cursor != null && cursor.getCount() != 0) {
        cursor.moveToNext();
        channel = Channel.fromCursor(cursor);
    }
}

Usage example when updating an existing channel:

Channel updatedChannel = new Channel.Builder(channel)
        .setDescription("New channel description")
        .build();
getContentResolver().update(TvContractCompat.buildChannelUri(updatedChannel.getId()),
        updatedChannel.toContentValues(), null, null);

Usage example when deleting a channel:

getContentResolver().delete(
        TvContractCompat.buildChannelUri(existingChannel.getId()), null, null);

Summary

Nested types

The builder class that makes it easy to chain setters to create a Channel object.

Public functions

equals

fun equals(other: Any!): Boolean

fromCursor

Added in 1.1.0-alpha02
java-static fun fromCursor(cursor: Cursor!): Channel!

Creates a Channel object from a cursor including the fields defined in Channels.

Parameters
cursor: Cursor!

A row from the TV Input Framework database.

Returns
Channel!

A channel with the values taken from the cursor.

getAppLinkColor

Added in 1.1.0-alpha02
fun getAppLinkColor(): Int
Returns
Int

The value of COLUMN_APP_LINK_COLOR for the channel.

getAppLinkIconUri

Added in 1.1.0-alpha02
fun getAppLinkIconUri(): Uri!
Returns
Uri!

The value of COLUMN_APP_LINK_ICON_URI for the channel.

getAppLinkIntent

Added in 1.1.0-alpha02
fun getAppLinkIntent(): Intent!
Returns
Intent!

The value of COLUMN_APP_LINK_INTENT_URI for the program.

getAppLinkIntentUri

Added in 1.1.0-alpha02
fun getAppLinkIntentUri(): Uri!
Returns
Uri!

The value of COLUMN_APP_LINK_INTENT_URI for the channel.

getAppLinkPosterArtUri

Added in 1.1.0-alpha02
fun getAppLinkPosterArtUri(): Uri!
Returns
Uri!

The value of COLUMN_APP_LINK_POSTER_ART_URI for the channel.

getAppLinkText

Added in 1.1.0-alpha02
fun getAppLinkText(): String!
Returns
String!

The value of COLUMN_APP_LINK_TEXT for the channel.

getConfigurationDisplayOrder

Added in 1.1.0-alpha02
fun getConfigurationDisplayOrder(): Int
Returns
Int

The value of COLUMN_CONFIGURATION_DISPLAY_ORDER for the channel.

getDescription

Added in 1.1.0-alpha02
fun getDescription(): String!
Returns
String!

The value of COLUMN_DESCRIPTION for the channel.

getDisplayName

Added in 1.1.0-alpha02
fun getDisplayName(): String!
Returns
String!

The value of COLUMN_DISPLAY_NAME for the channel.

getDisplayNumber

Added in 1.1.0-alpha02
fun getDisplayNumber(): String!
Returns
String!

The value of COLUMN_DISPLAY_NUMBER for the channel.

getGlobalContentId

Added in 1.1.0-alpha02
fun getGlobalContentId(): String?
Returns
String?

The value of COLUMN_GLOBAL_CONTENT_ID for the channel.

getId

Added in 1.1.0-alpha02
fun getId(): Long
Returns
Long

The value of _ID for the channel.

getInputId

Added in 1.1.0-alpha02
fun getInputId(): String!
Returns
String!

The value of COLUMN_INPUT_ID for the channel.

getInternalProviderDataByteArray

Added in 1.1.0-alpha02
fun getInternalProviderDataByteArray(): ByteArray<Byte>!
Returns
ByteArray<Byte>!

The value of COLUMN_INTERNAL_PROVIDER_DATA for the channel.

getInternalProviderFlag1

Added in 1.1.0-alpha02
fun getInternalProviderFlag1(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG1 for the channel.

getInternalProviderFlag2

Added in 1.1.0-alpha02
fun getInternalProviderFlag2(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG2 for the channel.

getInternalProviderFlag3

Added in 1.1.0-alpha02
fun getInternalProviderFlag3(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG3 for the channel.

getInternalProviderFlag4

Added in 1.1.0-alpha02
fun getInternalProviderFlag4(): Long!
Returns
Long!

The value of COLUMN_INTERNAL_PROVIDER_FLAG4 for the channel.

getInternalProviderId

Added in 1.1.0-alpha02
fun getInternalProviderId(): String!
Returns
String!

The value of COLUMN_INTERNAL_PROVIDER_ID for the channel.

getNetworkAffiliation

Added in 1.1.0-alpha02
fun getNetworkAffiliation(): String!
Returns
String!

The value of COLUMN_NETWORK_AFFILIATION for the channel.

getOriginalNetworkId

Added in 1.1.0-alpha02
fun getOriginalNetworkId(): Int
Returns
Int

The value of COLUMN_ORIGINAL_NETWORK_ID for the channel.

getPackageName

Added in 1.1.0-alpha02
fun getPackageName(): String!
Returns
String!

The value of COLUMN_PACKAGE_NAME for the channel.

getServiceId

Added in 1.1.0-alpha02
fun getServiceId(): Int
Returns
Int

The value of COLUMN_SERVICE_ID for the channel.

getServiceType

Added in 1.1.0-alpha02
fun getServiceType(): String!
Returns
String!

The value of COLUMN_SERVICE_TYPE for the channel.

Returns SERVICE_TYPE_AUDIO, SERVICE_TYPE_AUDIO_VIDEO, or SERVICE_TYPE_OTHER.

getSystemChannelKey

Added in 1.1.0-alpha02
fun getSystemChannelKey(): String!
Returns
String!

The value of COLUMN_SYSTEM_CHANNEL_KEY for the channel.

getTransportStreamId

Added in 1.1.0-alpha02
fun getTransportStreamId(): Int
Returns
Int

The value of COLUMN_TRANSPORT_STREAM_ID for the channel.

getType

Added in 1.1.0-alpha02
fun getType(): String!
Returns
String!

The value of COLUMN_TYPE for the channel.

getVideoFormat

Added in 1.1.0-alpha02
fun getVideoFormat(): String!
Returns
String!

The value of COLUMN_VIDEO_FORMAT for the channel.

hashCode

fun hashCode(): Int

isBrowsable

Added in 1.1.0-alpha02
fun isBrowsable(): Boolean
Returns
Boolean

The value of COLUMN_BROWSABLE for the channel.

isLocked

Added in 1.1.0-alpha02
fun isLocked(): Boolean
Returns
Boolean

The value of COLUMN_LOCKED for the channel.

isSearchable

Added in 1.1.0-alpha02
fun isSearchable(): Boolean
Returns
Boolean

The value of COLUMN_SEARCHABLE for the channel.

isTransient

Added in 1.1.0-alpha02
fun isTransient(): Boolean
Returns
Boolean

The value of COLUMN_TRANSIENT for the channel.

toContentValues

Added in 1.1.0-alpha02
fun toContentValues(): ContentValues!
Returns
ContentValues!

The fields of the Channel in the ContentValues format to be easily inserted into the TV Input Framework database.

toString

fun toString(): String!