Fields Summary |
---|
private static final String | KEY_ID |
private static final String | KEY_NAME |
private static final String | KEY_DESCRIPTION |
private static final String | KEY_ENABLED |
private static final String | KEY_CONNECTING |
private static final String | KEY_CONTROL_FILTERS |
private static final String | KEY_PLAYBACK_TYPE |
private static final String | KEY_PLAYBACK_STREAM |
private static final String | KEY_VOLUME |
private static final String | KEY_VOLUME_MAX |
private static final String | KEY_VOLUME_HANDLING |
private static final String | KEY_PRESENTATION_DISPLAY_ID |
private static final String | KEY_EXTRAS |
private static final String | KEY_CAN_DISCONNECT |
private static final String | KEY_SETTINGS_INTENT |
private final android.os.Bundle | mBundle |
private List | mControlFilters |
Methods Summary |
---|
public android.os.Bundle | asBundle()Converts this object to a bundle for serialization.
return mBundle;
|
public boolean | canDisconnectAndKeepPlaying()Gets whether the route can be disconnected without stopping playback. To
specify that the route should disconnect without stopping use
{@link MediaRouter#unselect(int)} with
{@link MediaRouter#UNSELECT_REASON_DISCONNECTED}.
return mBundle.getBoolean(KEY_CAN_DISCONNECT, false);
|
private void | ensureControlFilters()
if (mControlFilters == null) {
mControlFilters = mBundle.<IntentFilter>getParcelableArrayList(KEY_CONTROL_FILTERS);
if (mControlFilters == null) {
mControlFilters = Collections.<IntentFilter>emptyList();
}
}
|
public static android.support.v7.media.MediaRouteDescriptor | fromBundle(android.os.Bundle bundle)Creates an instance from a bundle.
return bundle != null ? new MediaRouteDescriptor(bundle, null) : null;
|
public java.util.List | getControlFilters()Gets the route's {@link MediaControlIntent media control intent} filters.
ensureControlFilters();
return mControlFilters;
|
public java.lang.String | getDescription()Gets the user-visible description of the route.
The route description describes the kind of destination represented by the route.
It may be a user-supplied string, a model number or brand of device.
return mBundle.getString(KEY_DESCRIPTION);
|
public android.os.Bundle | getExtras()Gets a bundle of extras for this route descriptor.
The extras will be ignored by the media router but they may be used
by applications.
return mBundle.getBundle(KEY_EXTRAS);
|
public java.lang.String | getId()Gets the unique id of the route.
The route id associated with a route descriptor functions as a stable
identifier for the route and must be unique among all routes offered
by the provider.
return mBundle.getString(KEY_ID);
|
public java.lang.String | getName()Gets the user-visible name of the route.
The route name identifies the destination represented by the route.
It may be a user-supplied name, an alias, or device serial number.
return mBundle.getString(KEY_NAME);
|
public int | getPlaybackStream()Gets the route's playback stream.
return mBundle.getInt(KEY_PLAYBACK_STREAM, -1);
|
public int | getPlaybackType()Gets the route's playback type.
return mBundle.getInt(KEY_PLAYBACK_TYPE, MediaRouter.RouteInfo.PLAYBACK_TYPE_REMOTE);
|
public int | getPresentationDisplayId()Gets the route's presentation display id, or -1 if none.
return mBundle.getInt(KEY_PRESENTATION_DISPLAY_ID, -1);
|
public android.content.IntentSender | getSettingsActivity()Gets an {@link IntentSender} for starting a settings activity for this
route. The activity may have specific route settings or general settings
for the connected device or route provider.
return mBundle.getParcelable(KEY_SETTINGS_INTENT);
|
public int | getVolume()Gets the route's current volume, or 0 if unknown.
return mBundle.getInt(KEY_VOLUME);
|
public int | getVolumeHandling()Gets the route's volume handling.
return mBundle.getInt(KEY_VOLUME_HANDLING,
MediaRouter.RouteInfo.PLAYBACK_VOLUME_FIXED);
|
public int | getVolumeMax()Gets the route's maximum volume, or 0 if unknown.
return mBundle.getInt(KEY_VOLUME_MAX);
|
public boolean | isConnecting()Gets whether the route is connecting.
return mBundle.getBoolean(KEY_CONNECTING, false);
|
public boolean | isEnabled()Gets whether the route is enabled.
return mBundle.getBoolean(KEY_ENABLED, true);
|
public boolean | isValid()Returns true if the route descriptor has all of the required fields.
ensureControlFilters();
if (TextUtils.isEmpty(getId())
|| TextUtils.isEmpty(getName())
|| mControlFilters.contains(null)) {
return false;
}
return true;
|
public java.lang.String | toString()
StringBuilder result = new StringBuilder();
result.append("MediaRouteDescriptor{ ");
result.append("id=").append(getId());
result.append(", name=").append(getName());
result.append(", description=").append(getDescription());
result.append(", isEnabled=").append(isEnabled());
result.append(", isConnecting=").append(isConnecting());
result.append(", controlFilters=").append(Arrays.toString(getControlFilters().toArray()));
result.append(", playbackType=").append(getPlaybackType());
result.append(", playbackStream=").append(getPlaybackStream());
result.append(", volume=").append(getVolume());
result.append(", volumeMax=").append(getVolumeMax());
result.append(", volumeHandling=").append(getVolumeHandling());
result.append(", presentationDisplayId=").append(getPresentationDisplayId());
result.append(", extras=").append(getExtras());
result.append(", isValid=").append(isValid());
result.append(" }");
return result.toString();
|