public final class

RouteListingPreference.Item

extends java.lang.Object

 java.lang.Object

↳androidx.mediarouter.media.RouteListingPreference.Item

Overview

Holds preference information for a specific route in a RouteListingPreference.

Summary

Fields
public static final intFLAG_ONGOING_SESSION

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

public static final intFLAG_ONGOING_SESSION_MANAGED

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

public static final intFLAG_SUGGESTED

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

public static final intSELECTION_BEHAVIOR_GO_TO_APP

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

public static final intSELECTION_BEHAVIOR_NONE

The corresponding route is not selectable by the user.

public static final intSELECTION_BEHAVIOR_TRANSFER

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

public static final intSUBTEXT_AD_ROUTING_DISALLOWED

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

public static final intSUBTEXT_CUSTOM

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

public static final intSUBTEXT_DEVICE_LOW_POWER

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

public static final intSUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED

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

public static final intSUBTEXT_ERROR_UNKNOWN

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

public static final intSUBTEXT_NONE

The corresponding route has no associated subtext.

public static final intSUBTEXT_SUBSCRIPTION_REQUIRED

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

public static final intSUBTEXT_TRACK_UNSUPPORTED

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

public static final intSUBTEXT_UNAUTHORIZED

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

Methods
public booleanequals(java.lang.Object other)

public java.lang.CharSequencegetCustomSubtextMessage()

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

public intgetFlags()

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

public java.lang.StringgetRouteId()

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

public intgetSelectionBehavior()

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

public intgetSubText()

Returns the type of subtext associated to this route.

public inthashCode()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int SELECTION_BEHAVIOR_NONE

The corresponding route is not selectable by the user.

public static final int SELECTION_BEHAVIOR_TRANSFER

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

public static final int SELECTION_BEHAVIOR_GO_TO_APP

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

The system uses RouteListingPreference.getLinkedItemComponentName() in order to navigate to the app.

public static final int FLAG_ONGOING_SESSION

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

public static final int FLAG_ONGOING_SESSION_MANAGED

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 RouteListingPreference.Item.FLAG_ONGOING_SESSION is not set, or if the corresponding route is not currently selected.

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

public static final int FLAG_SUGGESTED

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 RouteListingPreference.getItems() will take priority.

public static final int SUBTEXT_NONE

The corresponding route has no associated subtext.

public static final int SUBTEXT_ERROR_UNKNOWN

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

public static final int SUBTEXT_SUBSCRIPTION_REQUIRED

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

public static final int SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED

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

public static final int SUBTEXT_AD_ROUTING_DISALLOWED

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

public static final int SUBTEXT_DEVICE_LOW_POWER

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

public static final int SUBTEXT_UNAUTHORIZED

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

public static final int SUBTEXT_TRACK_UNSUPPORTED

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

public static final int SUBTEXT_CUSTOM

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

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

Methods

public java.lang.String getRouteId()

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

See also: MediaRouter.RouteInfo.getId()

public int getSelectionBehavior()

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

See also: RouteListingPreference.Item.SELECTION_BEHAVIOR_NONE, RouteListingPreference.Item.SELECTION_BEHAVIOR_TRANSFER, RouteListingPreference.Item.SELECTION_BEHAVIOR_GO_TO_APP

public int getFlags()

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

See also: RouteListingPreference.Item.FLAG_ONGOING_SESSION, RouteListingPreference.Item.FLAG_ONGOING_SESSION_MANAGED, RouteListingPreference.Item.FLAG_SUGGESTED

public int getSubText()

Returns the type of subtext associated to this route.

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

If this method returns RouteListingPreference.Item.SUBTEXT_CUSTOM, then the subtext is obtained form RouteListingPreference.Item.getCustomSubtextMessage().

See also: RouteListingPreference.Item.SUBTEXT_NONE, RouteListingPreference.Item.SUBTEXT_ERROR_UNKNOWN, RouteListingPreference.Item.SUBTEXT_SUBSCRIPTION_REQUIRED, RouteListingPreference.Item.SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED, RouteListingPreference.Item.SUBTEXT_AD_ROUTING_DISALLOWED, RouteListingPreference.Item.SUBTEXT_DEVICE_LOW_POWER, RouteListingPreference.Item.SUBTEXT_UNAUTHORIZED, RouteListingPreference.Item.SUBTEXT_TRACK_UNSUPPORTED, RouteListingPreference.Item.SUBTEXT_CUSTOM

public java.lang.CharSequence getCustomSubtextMessage()

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

This value is ignored if the subtext for this item is not RouteListingPreference.Item.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 RouteListingPreference.Item.getSubText() in order to guarantee correct visual representation and localization on all form factors.

public boolean equals(java.lang.Object other)

public int hashCode()