RouteListingPreference.Item


class RouteListingPreference.Item


Holds preference information for a specific route in a RouteListingPreference.

Summary

Constants

const Int

The corresponding route is already hosting a session with the app that owns this listing preference.

const Int

Signals that the ongoing session on the corresponding route is managed by the current user of the app.

const Int

The corresponding route is specially likely to be selected by the user.

const Int

If the user selects the corresponding route, the system takes the user to the application.

const Int

The corresponding route is not selectable by the user.

const Int

If the user selects the corresponding route, the media transfers to the said route.

const Int

The corresponding route's subtext must indicate that it is not available because an ad is in progress.

const Int

The corresponding route's subtext must be obtained from getCustomSubtextMessage.

const Int

The corresponding route's subtext must indicate that it is not available because the device is in low-power mode.

const Int

The corresponding route's subtext must indicate that downloaded content cannot be routed to it.

const Int

The corresponding route's subtext must indicate that it is not available because of an unknown error.

const Int

The corresponding route has no associated subtext.

const Int

The corresponding route's subtext must indicate that it requires a special subscription in order to be available for routing.

const Int

The corresponding route's subtext must indicate that it is not available because the device does not support the current media track.

const Int

The corresponding route's subtext must indicate that it is not available because the user is not authorized to route to it.

Public functions

Boolean
equals(other: Any!)
CharSequence?

Returns a human-readable CharSequence providing the subtext for the corresponding route.

Int

Returns the flags associated to the route that corresponds to this item.

String

Returns the id of the route that corresponds to this route listing preference item.

Int

Returns the behavior that the corresponding route has if the user selects it.

Int

Returns the type of subtext associated to this route.

Int

Constants

FLAG_ONGOING_SESSION

Added in 1.6.0
const val FLAG_ONGOING_SESSION = 1: Int

The corresponding route is already hosting a session with the app that owns this listing preference.

FLAG_ONGOING_SESSION_MANAGED

Added in 1.6.0
const val FLAG_ONGOING_SESSION_MANAGED = 2: Int

Signals that the ongoing session on the corresponding route is managed by the current user of the app.

The system can use this flag to provide visual indication that the route is not only hosting a session, but also that the user has ownership over said session.

This flag is ignored if FLAG_ONGOING_SESSION is not set, or if the corresponding route is not currently selected.

This flag does not affect volume adjustment (see , and getVolumeHandling), or any aspect other than the visual representation of the corresponding item.

FLAG_SUGGESTED

Added in 1.6.0
const val FLAG_SUGGESTED = 4: Int

The corresponding route is specially likely to be selected by the user.

A UI reflecting this preference may reserve a specific space for suggested routes, making it more accessible to the user. If the number of suggested routes exceeds the number supported by the UI, the routes listed first in getItems will take priority.

SELECTION_BEHAVIOR_GO_TO_APP

Added in 1.6.0
const val SELECTION_BEHAVIOR_GO_TO_APP = 2: Int

If the user selects the corresponding route, the system takes the user to the application.

The system uses getLinkedItemComponentName in order to navigate to the app.

SELECTION_BEHAVIOR_NONE

Added in 1.6.0
const val SELECTION_BEHAVIOR_NONE = 0: Int

The corresponding route is not selectable by the user.

SELECTION_BEHAVIOR_TRANSFER

Added in 1.6.0
const val SELECTION_BEHAVIOR_TRANSFER = 1: Int

If the user selects the corresponding route, the media transfers to the said route.

SUBTEXT_AD_ROUTING_DISALLOWED

Added in 1.6.0
const val SUBTEXT_AD_ROUTING_DISALLOWED = 4: Int

The corresponding route's subtext must indicate that it is not available because an ad is in progress.

SUBTEXT_CUSTOM

Added in 1.6.0
const val SUBTEXT_CUSTOM = 10000: Int

The corresponding route's subtext must be obtained from getCustomSubtextMessage.

Applications should strongly prefer one of the other disable reasons (for the full list, see getSubText) in order to guarantee correct localization and rendering across all form factors.

SUBTEXT_DEVICE_LOW_POWER

Added in 1.6.0
const val SUBTEXT_DEVICE_LOW_POWER = 5: Int

The corresponding route's subtext must indicate that it is not available because the device is in low-power mode.

SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED

Added in 1.6.0
const val SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED = 3: Int

The corresponding route's subtext must indicate that downloaded content cannot be routed to it.

SUBTEXT_ERROR_UNKNOWN

Added in 1.6.0
const val SUBTEXT_ERROR_UNKNOWN = 1: Int

The corresponding route's subtext must indicate that it is not available because of an unknown error.

SUBTEXT_NONE

Added in 1.6.0
const val SUBTEXT_NONE = 0: Int

The corresponding route has no associated subtext.

SUBTEXT_SUBSCRIPTION_REQUIRED

Added in 1.6.0
const val SUBTEXT_SUBSCRIPTION_REQUIRED = 2: Int

The corresponding route's subtext must indicate that it requires a special subscription in order to be available for routing.

SUBTEXT_TRACK_UNSUPPORTED

Added in 1.6.0
const val SUBTEXT_TRACK_UNSUPPORTED = 7: Int

The corresponding route's subtext must indicate that it is not available because the device does not support the current media track.

SUBTEXT_UNAUTHORIZED

Added in 1.6.0
const val SUBTEXT_UNAUTHORIZED = 6: Int

The corresponding route's subtext must indicate that it is not available because the user is not authorized to route to it.

Public functions

equals

fun equals(other: Any!): Boolean

getCustomSubtextMessage

Added in 1.6.0
fun getCustomSubtextMessage(): CharSequence?

Returns a human-readable CharSequence providing the subtext for the corresponding route.

This value is ignored if the subtext for this item is not SUBTEXT_CUSTOM..

Applications must provide a localized message that matches the system's locale. See getDefault.

Applications should avoid using custom messages (and instead use one of non-custom subtexts listed in getSubText in order to guarantee correct visual representation and localization on all form factors.

getFlags

Added in 1.6.0
fun getFlags(): Int

Returns the flags associated to the route that corresponds to this item.

getRouteId

Added in 1.6.0
fun getRouteId(): String

Returns the id of the route that corresponds to this route listing preference item.

See also
getId

getSelectionBehavior

Added in 1.6.0
fun getSelectionBehavior(): Int

Returns the behavior that the corresponding route has if the user selects it.

hashCode

fun hashCode(): Int