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 |
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 |
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 | |
CharSequence? |
Returns a human-readable |
Int |
getFlags() 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 |
hashCode() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<RouteListingPreference.Item!> |
Constants
FLAG_ONGOING_SESSION
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
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
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
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
static val SELECTION_BEHAVIOR_NONE: Int
The corresponding route is not selectable by the user.
Value: 0
SELECTION_BEHAVIOR_TRANSFER
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
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
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
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
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
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
static val SUBTEXT_NONE: Int
The corresponding route has no associated subtext.
Value: 0
SUBTEXT_SUBSCRIPTION_REQUIRED
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
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
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
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
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
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 . |
getFlags
fun getFlags(): Int
Returns the flags associated to the route that corresponds to this item.
Return | |
---|---|
Int |
Value is either 0 or a combination of android.media.RouteListingPreference.Item#FLAG_ONGOING_SESSION , android.media.RouteListingPreference.Item#FLAG_ONGOING_SESSION_MANAGED , and android.media.RouteListingPreference.Item#FLAG_SUGGESTED |
getRouteId
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
fun getSelectionBehavior(): Int
Returns the behavior that the corresponding route has if the user selects it.
getSubText
fun getSubText(): Int
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()
.
writeToParcel
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 |