Search in sources :

Example 16 with RouteInfo

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);
}
Also used : RouteInfo(android.media.MediaRouter.RouteInfo)

Example 17 with RouteInfo

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();
}
Also used : RouteInfo(android.media.MediaRouter.RouteInfo)

Example 18 with RouteInfo

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);
}
Also used : RouteInfo(android.media.MediaRouter.RouteInfo) Test(org.junit.Test)

Example 19 with RouteInfo

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();
}
Also used : RouteInfo(android.media.MediaRouter.RouteInfo) Test(org.junit.Test)

Example 20 with RouteInfo

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);
}
Also used : RouteInfo(android.media.MediaRouter.RouteInfo) Test(org.junit.Test)

Aggregations

RouteInfo (android.media.MediaRouter.RouteInfo)33 Test (org.junit.Test)8 ArraySet (android.util.ArraySet)5 Config (org.robolectric.annotation.Config)3 RouteGroup (android.media.MediaRouter.RouteGroup)1 Display (android.view.Display)1 WindowManager (android.view.WindowManager)1