Methods Summary |
---|
public android.os.Bundle | asBundle()Converts this object to a bundle for serialization.
return mBundle;
|
private void | ensureRoutes()
if (mRoutes == null) {
ArrayList<Bundle> routeBundles = mBundle.<Bundle>getParcelableArrayList(KEY_ROUTES);
if (routeBundles == null || routeBundles.isEmpty()) {
mRoutes = Collections.<MediaRouteDescriptor>emptyList();
} else {
final int count = routeBundles.size();
mRoutes = new ArrayList<MediaRouteDescriptor>(count);
for (int i = 0; i < count; i++) {
mRoutes.add(MediaRouteDescriptor.fromBundle(routeBundles.get(i)));
}
}
}
|
public static android.support.v7.media.MediaRouteProviderDescriptor | fromBundle(android.os.Bundle bundle)Creates an instance from a bundle.
return bundle != null ? new MediaRouteProviderDescriptor(bundle, null) : null;
|
public java.util.List | getRoutes()Gets the list of all routes that this provider has published.
ensureRoutes();
return mRoutes;
|
public boolean | isValid()Returns true if the route provider descriptor and all of the routes that
it contains have all of the required fields.
This verification is deep. If the provider descriptor is known to be
valid then it is not necessary to call {@link #isValid} on each of its routes.
ensureRoutes();
final int routeCount = mRoutes.size();
for (int i = 0; i < routeCount; i++) {
MediaRouteDescriptor route = mRoutes.get(i);
if (route == null || !route.isValid()) {
return false;
}
}
return true;
|
public java.lang.String | toString()
StringBuilder result = new StringBuilder();
result.append("MediaRouteProviderDescriptor{ ");
result.append("routes=").append(
Arrays.toString(getRoutes().toArray()));
result.append(", isValid=").append(isValid());
result.append(" }");
return result.toString();
|