コード例 #1
0
  /**
   * @param type TV(1) radio(2)
   * @return
   */
  public List<DtvProgram> getDtvChannels(int type) {
    ArrayList<DtvProgram> list;
    int channeltype = DTVConstant.ConstServiceType.SERVICE_TYPE_TV;
    if (type == DTVConstant.ConstServiceType.SERVICE_TYPE_RADIO) {

      channeltype = DTVConstant.ConstServiceType.SERVICE_TYPE_RADIO;
    }
    list = new ArrayList<DtvProgram>();
    DTVChannelBaseInfo[] channels = mChannelInfoMagager.getChannelListByTpye(channeltype);
    if (channels != null) {
      Log.e(TAG, "LL length of channelList is " + channels.length);

      for (DTVChannelBaseInfo chChannel : channels) {
        list.add(new DtvProgram(chChannel));
        Log.i(TAG, "LL chChannel.mstrServiceName = " + chChannel.mstrServiceName);
      }
    }
    return list;
  }
コード例 #2
0
  /**
   * @param type TV(1) radio(2)
   * @return
   */
  public List<DtvProgram> getWatchedChannelList(int type) {
    ArrayList<DtvProgram> list = new ArrayList<DtvProgram>();
    DTVChannelBaseInfo[] channels =
        mChannelInfoMagager.getChannelListByTpye(CHANNEL_LIST_TYPE_WATCHED);
    if (channels != null) {
      Log.e(
          TAG, "LL getWatchedChannelList()>>length of watched channel list is " + channels.length);

      for (DTVChannelBaseInfo chChannel : channels) {
        // Log.i("YangLiu",
        // chChannel.mstrServiceName+"的miServiceType为:"+chChannel.miServiceType);
        if (chChannel.miServiceType == type) {
          Log.i(
              TAG,
              "LL getWatchedChannelList()>>chChannel.mstrServiceName = "
                  + chChannel.mstrServiceName);
          list.add(new DtvProgram(chChannel));
        }
      }
    }
    return list;
  }