RouteListingPreference.Item


public final class RouteListingPreference.Item


Holds preference information for a specific route in a RouteListingPreference.

Summary

Nested types

Builder for RouteListingPreference.Item.

Constants

static final int

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

static final int

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

static final int

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

static final int

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

static final int

The corresponding route is not selectable by the user.

static final int

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

static final int

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

static final int

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

static final int

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

static final int

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

static final int

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

static final int

The corresponding route has no associated subtext.

static final int

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

static final int

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

static final int

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

Public methods

boolean
equals(Object other)
@Nullable 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.

@NonNull 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
public static final int FLAG_ONGOING_SESSION = 1

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
public static final int FLAG_ONGOING_SESSION_MANAGED = 2

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
public static final int FLAG_SUGGESTED = 4

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
public static final int SELECTION_BEHAVIOR_GO_TO_APP = 2

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
public static final int SELECTION_BEHAVIOR_NONE = 0

The corresponding route is not selectable by the user.

SELECTION_BEHAVIOR_TRANSFER

Added in 1.6.0
public static final int SELECTION_BEHAVIOR_TRANSFER = 1

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

SUBTEXT_AD_ROUTING_DISALLOWED

Added in 1.6.0
public static final int SUBTEXT_AD_ROUTING_DISALLOWED = 4

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
public static final int SUBTEXT_CUSTOM = 10000

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
public static final int SUBTEXT_DEVICE_LOW_POWER = 5

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
public static final int SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED = 3

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

SUBTEXT_ERROR_UNKNOWN

Added in 1.6.0
public static final int SUBTEXT_ERROR_UNKNOWN = 1

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

SUBTEXT_NONE

Added in 1.6.0
public static final int SUBTEXT_NONE = 0

The corresponding route has no associated subtext.

SUBTEXT_SUBSCRIPTION_REQUIRED

Added in 1.6.0
public static final int SUBTEXT_SUBSCRIPTION_REQUIRED = 2

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
public static final int SUBTEXT_TRACK_UNSUPPORTED = 7

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
public static final int SUBTEXT_UNAUTHORIZED = 6

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

Public methods

equals

public boolean equals(Object other)

getCustomSubtextMessage

Added in 1.6.0
public @Nullable CharSequence getCustomSubtextMessage()

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
public int getFlags()

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

getRouteId

Added in 1.6.0
public @NonNull String getRouteId()

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

See also
getId

getSelectionBehavior

Added in 1.6.0
public int getSelectionBehavior()

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

getSubText

Added in 1.6.0
public int getSubText()

Returns the type of subtext associated to this route.

Subtext types other than SUBTEXT_NONE and SUBTEXT_CUSTOM must not have SELECTION_BEHAVIOR_TRANSFER.

If this method returns SUBTEXT_CUSTOM, then the subtext is obtained form getCustomSubtextMessage.

hashCode

public int hashCode()