RouteListingPreference


public final class RouteListingPreference


Allows applications to customize the list of routes used for media routing (for example, in the System UI Output Switcher).

Summary

Nested types

Builder for RouteListingPreference.

public final class RouteListingPreference.Item

Holds preference information for a specific route in a RouteListingPreference.

Builder for RouteListingPreference.Item.

Constants

static final String
ACTION_TRANSFER_MEDIA = "android.media.action.TRANSFER_MEDIA"

Intent action that the system uses to take the user the app when the user selects an RouteListingPreference.Item whose selection behavior is SELECTION_BEHAVIOR_GO_TO_APP.

static final String
EXTRA_ROUTE_ID = "android.media.extra.ROUTE_ID"

Intent string extra key that contains the id of the route to transfer to, as part of an ACTION_TRANSFER_MEDIA intent.

Public methods

boolean
equals(Object other)
@NonNull List<RouteListingPreference.Item>

Returns an unmodifiable list containing the items that the app wants to be listed for media routing.

@Nullable ComponentName

Returns a ComponentName for navigating to the application.

int
boolean

Returns true if the application would like media route listing to use the system's ordering strategy, or false if the application would like route listing to respect the ordering obtained from getItems.

Constants

ACTION_TRANSFER_MEDIA

Added in 1.6.0
public static final String ACTION_TRANSFER_MEDIA = "android.media.action.TRANSFER_MEDIA"

Intent action that the system uses to take the user the app when the user selects an RouteListingPreference.Item whose selection behavior is SELECTION_BEHAVIOR_GO_TO_APP.

The launched intent will identify the selected item using the extra identified by EXTRA_ROUTE_ID.

EXTRA_ROUTE_ID

Added in 1.6.0
public static final String EXTRA_ROUTE_ID = "android.media.extra.ROUTE_ID"

Intent string extra key that contains the id of the route to transfer to, as part of an ACTION_TRANSFER_MEDIA intent.

Public methods

equals

public boolean equals(Object other)

getItems

Added in 1.6.0
public @NonNull List<RouteListingPreference.ItemgetItems()

Returns an unmodifiable list containing the items that the app wants to be listed for media routing.

getLinkedItemComponentName

Added in 1.6.0
public @Nullable ComponentName getLinkedItemComponentName()

Returns a ComponentName for navigating to the application.

Must not be null if any of the items of this route listing preference has selection behaviorSELECTION_BEHAVIOR_GO_TO_APP.

The system navigates to the application when the user selects with SELECTION_BEHAVIOR_GO_TO_APP by launching an intent to the returned ComponentName, using action ACTION_TRANSFER_MEDIA, with the extra EXTRA_ROUTE_ID.

hashCode

public int hashCode()

isSystemOrderingEnabled

Added in 1.6.0
public boolean isSystemOrderingEnabled()

Returns true if the application would like media route listing to use the system's ordering strategy, or false if the application would like route listing to respect the ordering obtained from getItems.

The system's ordering strategy is implementation-dependent, but may take into account each route's recency or frequency of use in order to rank them.