Exemplo n.º 1
0
 public void selectRoute(Object paramObject1, int paramInt, Object paramObject2)
 {
   MediaRouter localMediaRouter = (MediaRouter)paramObject1;
   MediaRouter.RouteInfo localRouteInfo = (MediaRouter.RouteInfo)paramObject2;
   int i = localRouteInfo.getSupportedTypes();
   if (((0x800000 & i) != 0) || (this.mSelectRouteIntMethod != null));
   while (true)
   {
     try
     {
       Method localMethod = this.mSelectRouteIntMethod;
       Object[] arrayOfObject = new Object[2];
       Integer localInteger = Integer.valueOf(paramInt);
       arrayOfObject[0] = localInteger;
       arrayOfObject[1] = localRouteInfo;
       Object localObject = localMethod.invoke(localMediaRouter, arrayOfObject);
       return;
     }
     catch (IllegalAccessException localIllegalAccessException)
     {
       int j = Log.w("MediaRouterJellybean", "Cannot programmatically select non-user route.  Media routing may not work.", localIllegalAccessException);
       localMediaRouter.selectRoute(paramInt, localRouteInfo);
       return;
     }
     catch (InvocationTargetException localInvocationTargetException)
     {
       int k = Log.w("MediaRouterJellybean", "Cannot programmatically select non-user route.  Media routing may not work.", localInvocationTargetException);
       continue;
     }
     int m = Log.w("MediaRouterJellybean", "Cannot programmatically select non-user route because the platform is missing the selectRouteInt() method.  Media routing may not work.");
   }
 }
    public void selectRoute(Object routerObj, int types, Object routeObj) {
      android.media.MediaRouter router = (android.media.MediaRouter) routerObj;
      android.media.MediaRouter.RouteInfo route = (android.media.MediaRouter.RouteInfo) routeObj;

      int routeTypes = route.getSupportedTypes();
      if ((routeTypes & ROUTE_TYPE_USER) == 0) {
        // Handle non-user routes.
        // On JB and JB MR1, the selectRoute() API only supports programmatically
        // selecting user routes.  So instead we rely on the hidden selectRouteInt()
        // method on these versions of the platform.
        // This limitation was removed in JB MR2.
        if (mSelectRouteIntMethod != null) {
          try {
            mSelectRouteIntMethod.invoke(router, types, route);
            return; // success!
          } catch (IllegalAccessException ex) {
            Log.w(
                TAG,
                "Cannot programmatically select non-user route.  " + "Media routing may not work.",
                ex);
          } catch (InvocationTargetException ex) {
            Log.w(
                TAG,
                "Cannot programmatically select non-user route.  " + "Media routing may not work.",
                ex);
          }
        } else {
          Log.w(
              TAG,
              "Cannot programmatically select non-user route "
                  + "because the platform is missing the selectRouteInt() "
                  + "method.  Media routing may not work.");
        }
      }

      // Default handling.
      router.selectRoute(types, route);
    }
 public static void selectRoute(Object paramObject1, int paramInt, Object paramObject2) {
   ((MediaRouter) paramObject1).selectRoute(paramInt, (MediaRouter.RouteInfo) paramObject2);
 }
Exemplo n.º 4
0
 public static void selectRoute(Object paramObject1, int paramInt, Object paramObject2)
 {
   MediaRouter localMediaRouter = (MediaRouter)paramObject1;
   MediaRouter.RouteInfo localRouteInfo = (MediaRouter.RouteInfo)paramObject2;
   localMediaRouter.selectRoute(paramInt, localRouteInfo);
 }