Ejemplo n.º 1
0
  public ArrayList<DTVChannelBaseInfo> getDtvChannelList() {
    ArrayList<DTVChannelBaseInfo> dtvChannelList = null;
    if (CheckServiceBinder() != 0) {
      Log.i(TAG, "LocalChannelUtil>>getDtvChannelList>>CheckServiceBinder service binder failed");
      return null;
    }

    try {
      //			DTVChannelDetailInfo[] tmpList =
      // mIChannelManagerServer.getChanneDetailInfoListByTpye(DTVConstant.ConstServiceType.SERVICE_TYPE_ALL);
      DTVChannelBaseInfo[] tmpList =
          mIChannelManagerServer.getChannelListByTpye(
              DTVConstant.ConstServiceType.SERVICE_TYPE_ALL);
      if ((tmpList == null) || (tmpList.length <= 0)) {
        Log.e(TAG, "LocalChannelUtil>>getDtvChannelList>>[getChanneDetailInfoListByTpye NULL]");
        return null;
      }

      dtvChannelList = new ArrayList<DTVChannelBaseInfo>();
      for (int i = 0; i < tmpList.length; i++) {
        dtvChannelList.add(tmpList[i]);
      }
    } catch (RemoteException exception) {
      Log.e(TAG, "LocalChannelUtil>>getDtvChannelList>>[getChannelList exception]");
      return null;
    }

    Log.e(
        TAG, "LocalChannelUtil>>getDtvChannelList>>[DtvChannelList.size]" + dtvChannelList.size());
    return dtvChannelList;
  }
Ejemplo n.º 2
0
 private int CheckServiceBinder() {
   Log.i(TAG, "[checkServiceBinder]");
   int iret = -1;
   if (mIDtvServer == null) {
     IBinder binder;
     binder = ServiceManager.getService(DTVConstant.DTV_SERVICE_NAME);
     Log.i(TAG, "[binder]" + binder);
     if (binder != null) {
       mIDtvServer = IDTVService.Stub.asInterface(binder);
       Log.i(TAG, "[mIDtvServer]" + mIDtvServer);
       if (mIDtvServer == null) {
         Log.i(TAG, "[mIDtvServer is null]");
         return iret;
       }
     } else {
       Log.i(TAG, "[service binder failed!]");
       return iret;
     }
   }
   if (mIChannelManagerServer == null) {
     try {
       IBinder binder = mIDtvServer.CreateChannelManager(null);
       Log.i(TAG, "[binder2]" + binder);
       if (binder != null) {
         mIChannelManagerServer = IChannelManager.Stub.asInterface(binder);
         Log.i(TAG, "[mIChannelManagerServer]" + mIChannelManagerServer);
         if (mIChannelManagerServer == null) {
           Log.i(TAG, "[mIChannelManagerServer is null]");
           return iret;
         }
         mIChannelManagerServer.setChannelSource(DTVConstant.ConstDemodType.DVB_C, 0);
       }
       return iret;
     } catch (RemoteException exception) {
       Log.i(TAG, "[CreateChannelManager binder failed!]");
     }
   }
   iret = 0;
   Log.i(TAG, "[iret]" + iret);
   return iret;
 }