Added in API level 34

Item


class Item : Parcelable
kotlin.Any
   ↳ android.media.RouteListingPreference.Item

Holds preference information for a specific route in a RouteListingPreference.

Summary

Nested classes

Builder for Item.

Constants
static Int

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

static Int

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

static Int

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

static Int

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

static Int

The corresponding route is not selectable by the user.

static Int

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

static Int

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

static Int

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

static Int

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

static Int

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

static Int

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

static Int

The corresponding route has no associated subtext.

static Int

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

static Int

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

static Int

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

Inherited constants
Public methods
Int

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

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<RouteListingPreference.Item!>

Constants

FLAG_ONGOING_SESSION

Added in API level 34
static val FLAG_ONGOING_SESSION: Int

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

Value: 1

FLAG_ONGOING_SESSION_MANAGED

Added in API level 34
static val FLAG_ONGOING_SESSION_MANAGED: 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 VolumeProvider, and android.media.MediaRoute2Info#getVolumeHandling()), or any aspect other than the visual representation of the corresponding item.

Value: 2

FLAG_SUGGESTED

Added in API level 34
static val FLAG_SUGGESTED: 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 android.media.RouteListingPreference#getItems() will take priority.

Value: 4

SELECTION_BEHAVIOR_GO_TO_APP

Added in API level 34
static val SELECTION_BEHAVIOR_GO_TO_APP: 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.

Value: 2

SELECTION_BEHAVIOR_NONE

Added in API level 34
static val SELECTION_BEHAVIOR_NONE: Int

The corresponding route is not selectable by the user.

Value: 0

SELECTION_BEHAVIOR_TRANSFER

Added in API level 34
static val SELECTION_BEHAVIOR_TRANSFER: Int

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

Value: 1

SUBTEXT_AD_ROUTING_DISALLOWED

Added in API level 34
static val SUBTEXT_AD_ROUTING_DISALLOWED: Int

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

Value: 4

SUBTEXT_CUSTOM

Added in API level 34
static val SUBTEXT_CUSTOM: 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.

Value: 10000

SUBTEXT_DEVICE_LOW_POWER

Added in API level 34
static val SUBTEXT_DEVICE_LOW_POWER: Int

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

Value: 5

SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED

Added in API level 34
static val SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED: Int

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

Value: 3

SUBTEXT_ERROR_UNKNOWN

Added in API level 34
static val SUBTEXT_ERROR_UNKNOWN: Int

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

Value: 1

SUBTEXT_NONE

Added in API level 34
static val SUBTEXT_NONE: Int

The corresponding route has no associated subtext.

Value: 0

SUBTEXT_SUBSCRIPTION_REQUIRED

Added in API level 34
static val SUBTEXT_SUBSCRIPTION_REQUIRED: Int

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

Value: 2

SUBTEXT_TRACK_UNSUPPORTED

Added in API level 34
static val SUBTEXT_TRACK_UNSUPPORTED: Int

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

Value: 7

SUBTEXT_UNAUTHORIZED

Added in API level 34
static val SUBTEXT_UNAUTHORIZED: Int

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

Value: 6

Public methods

describeContents

Added in API level 34
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 34
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getCustomSubtextMessage

Added in API level 34
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 Locale.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.

Return
CharSequence? This value may be null.

getRouteId

Added in API level 34
fun getRouteId(): String

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

Return
String This value cannot be null.

getSelectionBehavior

Added in API level 34
fun getSelectionBehavior(): Int

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

hashCode

Added in API level 34
fun hashCode(): Int
Return
Int a hash code value for this object.

writeToParcel

Added in API level 34
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 34
static val CREATOR: Parcelable.Creator<RouteListingPreference.Item!>