use of android.media.MediaRouter.RouteInfo in project platform_frameworks_base by android.
the class CastControllerImpl method updateRemoteDisplays.
private void updateRemoteDisplays() {
synchronized (mRoutes) {
mRoutes.clear();
final int n = mMediaRouter.getRouteCount();
for (int i = 0; i < n; i++) {
final RouteInfo route = mMediaRouter.getRouteAt(i);
if (!route.isEnabled())
continue;
if (!route.matchesTypes(ROUTE_TYPE_REMOTE_DISPLAY))
continue;
ensureTagExists(route);
mRoutes.put(route.getTag().toString(), route);
}
final RouteInfo selected = mMediaRouter.getSelectedRoute(ROUTE_TYPE_REMOTE_DISPLAY);
if (selected != null && !selected.isDefault()) {
ensureTagExists(selected);
mRoutes.put(selected.getTag().toString(), selected);
}
}
fireOnCastDevicesChanged();
}
use of android.media.MediaRouter.RouteInfo in project platform_frameworks_base by android.
the class CastControllerImpl method startCasting.
@Override
public void startCasting(CastDevice device) {
if (device == null || device.tag == null)
return;
final RouteInfo route = (RouteInfo) device.tag;
if (DEBUG)
Log.d(TAG, "startCasting: " + routeToString(route));
mMediaRouter.selectRoute(ROUTE_TYPE_REMOTE_DISPLAY, route);
}
use of android.media.MediaRouter.RouteInfo in project platform_frameworks_base by android.
the class CastControllerImpl method dump.
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("CastController state:");
pw.print(" mDiscovering=");
pw.println(mDiscovering);
pw.print(" mCallbackRegistered=");
pw.println(mCallbackRegistered);
pw.print(" mCallbacks.size=");
pw.println(mCallbacks.size());
pw.print(" mRoutes.size=");
pw.println(mRoutes.size());
for (int i = 0; i < mRoutes.size(); i++) {
final RouteInfo route = mRoutes.valueAt(i);
pw.print(" ");
pw.println(routeToString(route));
}
pw.print(" mProjection=");
pw.println(mProjection);
}
use of android.media.MediaRouter.RouteInfo in project android_frameworks_base by crdroidandroid.
the class CastControllerImpl method dump.
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("CastController state:");
pw.print(" mDiscovering=");
pw.println(mDiscovering);
pw.print(" mCallbackRegistered=");
pw.println(mCallbackRegistered);
pw.print(" mCallbacks.size=");
pw.println(mCallbacks.size());
pw.print(" mRoutes.size=");
pw.println(mRoutes.size());
for (int i = 0; i < mRoutes.size(); i++) {
final RouteInfo route = mRoutes.valueAt(i);
pw.print(" ");
pw.println(routeToString(route));
}
pw.print(" mProjection=");
pw.println(mProjection);
}
use of android.media.MediaRouter.RouteInfo in project android_frameworks_base by crdroidandroid.
the class CastControllerImpl method updateRemoteDisplays.
private void updateRemoteDisplays() {
synchronized (mRoutes) {
mRoutes.clear();
final int n = mMediaRouter.getRouteCount();
for (int i = 0; i < n; i++) {
final RouteInfo route = mMediaRouter.getRouteAt(i);
if (!route.isEnabled())
continue;
if (!route.matchesTypes(ROUTE_TYPE_REMOTE_DISPLAY))
continue;
ensureTagExists(route);
mRoutes.put(route.getTag().toString(), route);
}
final RouteInfo selected = mMediaRouter.getSelectedRoute(ROUTE_TYPE_REMOTE_DISPLAY);
if (selected != null && !selected.isDefault()) {
ensureTagExists(selected);
mRoutes.put(selected.getTag().toString(), selected);
}
}
fireOnCastDevicesChanged();
}
Aggregations