class SelectionInfo


Information about a route selection.

This information is available in callbacks like onRouteSelected for apps to know the reason and the source of the event. For example, you can check if the route was selected by the app (SELECTION_SOURCE_APP) (this includes in-app UI interactions) or via the system output switcher (SELECTION_SOURCE_SYSTEM). Similarly, apps can know if the previous route was unselected because it was disconnected (UNSELECT_REASON_DISCONNECTED) or simply stopped (UNSELECT_REASON_STOPPED).

Summary

Nested types

Builder for SelectionInfo.

Constants

const Int

The route was selected because the application explicitly requested it (for example, by calling selectRoute).

const Int

The route was selected because the provider changed the route (for example, fallback to default route when the active route is disconnected by the provider).

const Int

The route was selected because of a system/platform event (for example, System Output Switcher selection).

const Int

Passed when the reason the route was selected is unknown.

Public functions

Int

Returns the source of the route selection.

Int

Returns the unselect reason of the previously selected route.

Constants

SELECTION_SOURCE_APP

Added in 1.9.0-alpha02
const val SELECTION_SOURCE_APP = 1: Int

The route was selected because the application explicitly requested it (for example, by calling selectRoute).

SELECTION_SOURCE_PROVIDER

Added in 1.9.0-alpha02
const val SELECTION_SOURCE_PROVIDER = 3: Int

The route was selected because the provider changed the route (for example, fallback to default route when the active route is disconnected by the provider).

SELECTION_SOURCE_SYSTEM

Added in 1.9.0-alpha02
const val SELECTION_SOURCE_SYSTEM = 2: Int

The route was selected because of a system/platform event (for example, System Output Switcher selection).

SELECTION_SOURCE_UNKNOWN

Added in 1.9.0-alpha02
const val SELECTION_SOURCE_UNKNOWN = 0: Int

Passed when the reason the route was selected is unknown.

Public functions

getSelectionSource

Added in 1.9.0-alpha02
fun getSelectionSource(): Int

Returns the source of the route selection.

getUnselectReason

Added in 1.9.0-alpha02
fun getUnselectReason(): Int

Returns the unselect reason of the previously selected route.