Search in sources :

Example 11 with RouteInfo

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

Example 12 with RouteInfo

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

Example 13 with RouteInfo

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

Example 14 with RouteInfo

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

Example 15 with RouteInfo

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

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