use of android.media.MediaRouter.RouteInfo in project android_frameworks_base by AOSPA.
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 AOSPA.
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 robolectric by robolectric.
the class ShadowMediaRouterTest method testAddBluetoothRoute_checkBluetoothRouteProperties.
@Test
public void testAddBluetoothRoute_checkBluetoothRouteProperties() {
shadowOf(mediaRouter).addBluetoothRoute();
RouteInfo bluetoothRoute = mediaRouter.getRouteAt(1);
assertThat(bluetoothRoute.getName().toString()).isEqualTo(ShadowMediaRouter.BLUETOOTH_DEVICE_NAME);
}
use of android.media.MediaRouter.RouteInfo in project robolectric by robolectric.
the class ShadowMediaRouterTest method testIsBluetoothRouteSelected_bluetoothRouteSelected_returnsTrue.
@Test
public void testIsBluetoothRouteSelected_bluetoothRouteSelected_returnsTrue() {
shadowOf(mediaRouter).addBluetoothRoute();
RouteInfo bluetoothRoute = mediaRouter.getRouteAt(1);
mediaRouter.selectRoute(ROUTE_TYPE_LIVE_AUDIO, bluetoothRoute);
assertThat(shadowOf(mediaRouter).isBluetoothRouteSelected(ROUTE_TYPE_LIVE_AUDIO)).isTrue();
}
use of android.media.MediaRouter.RouteInfo in project robolectric by robolectric.
the class ShadowMediaRouterTest method testAddBluetoothRoute_bluetoothRouteSelected.
@Test
public void testAddBluetoothRoute_bluetoothRouteSelected() {
shadowOf(mediaRouter).addBluetoothRoute();
RouteInfo bluetoothRoute = mediaRouter.getRouteAt(1);
assertThat(mediaRouter.getSelectedRoute(ROUTE_TYPE_LIVE_AUDIO)).isEqualTo(bluetoothRoute);
}
Aggregations