示例#1
0
  private void go2BootDefaultChannel(int serviceId) {
    ServiceInfoDao serInfoDao = new ServiceInfoDaoImpl(this);
    List<ServiceInfoBean> nBeans = serInfoDao.getChannelIdByLogicalNumber(serviceId);
    ServiceInfoBean nBean = null;
    if (nBeans.size() != 0) {
      nBean = nBeans.get(0);
    }
    if (null == nBean) {
      LogUtils.printLog(1, 5, TAG, "--->>> get boot default channel is null !");
      finish();
      return;
    }

    Bundle bundle = new Bundle();
    bundle.putInt("ServicePos", nBean.getChannelPosition());
    bundle.putInt("LogicalNumber", serviceId);
    bundle.putInt("ServiceId", serviceId);
    bundle.putString("ServiceName", nBean.getChannelName());
    bundle.putChar("ServiceType", nBean.getServiceType());
    bundle.putString("superPwd", superPwd);
    bundle.putInt("Grade", grade);
    bundle.putBoolean("RecStatus", recStatus);
    CommonUtils.skipActivity(
        SplashActivity.this, TVChannelPlay.class, bundle, Intent.FLAG_ACTIVITY_CLEAR_TOP);
  }
示例#2
0
  /**
   * <Parser the last play program.>
   *
   * @return
   * @see [类、类#方法、类#成员]
   */
  private void parserLastProgram() {
    ServiceInfoDao serInfoDao = new ServiceInfoDaoImpl(this);
    tvList = serInfoDao.getTVChannelInfo();
    radioList = serInfoDao.getRadioChannelInfo();
    SharedPreferences spChannel =
        getSharedPreferences(Config.DVB_LASTPLAY_SERVICE, MODE_WORLD_READABLE);

    // parser last play programme.
    int radioServiceId = spChannel.getInt("radio_serviceId", 0);
    int radioNumber = spChannel.getInt("radio_logicalNumber", 0);
    int radioServicePos = spChannel.getInt("radio_servicePosition", 0);
    String radioServiceName = spChannel.getString("radio_serviceName", null);

    int tvServiceId = spChannel.getInt("tv_serviceId", 0);
    int tvNumber = spChannel.getInt("tv_logicalNumber", 0);
    int tvServicePos = spChannel.getInt("tv_servicePosition", 0);
    String tvServiceName = spChannel.getString("tv_serviceName", null);

    ServiceInfoBean rBean = serInfoDao.getChannelInfoByServiceId(radioServiceId, radioNumber);
    ServiceInfoBean tBean = serInfoDao.getChannelInfoByServiceId(tvServiceId, tvNumber);

    if (null != entrance) {
      if (entrance.equals(Config.DVB_RADIO_PROGRAMME)) {
        if (radioList.size() != 0) {
          // invalid radio programme.
          if (null == rBean || null == radioServiceName) {
            ServiceInfoBean radioBean = radioList.get(0);

            serviceId = radioBean.getServiceId();
            servicePos = radioBean.getChannelPosition();
            logicalNumber = radioBean.getLogicalNumber();
            serviceName = radioBean.getChannelName();
            serviceType = radioBean.getServiceType();
          } else {
            serviceId = radioServiceId;
            servicePos = radioServicePos;
            logicalNumber = radioNumber;
            serviceName = radioServiceName;
            serviceType = Config.SERVICE_TYPE_RADIO;
          }
        }
      }
      if (entrance.equals(Config.DVB_TV_PROGRAMME)
          || entrance.equals(Config.DVB_EPG)
          || entrance.equals(Config.DVB_CA_USER_VIEW)) {
        if (tvList.size() != 0) {
          // invalid tv program.
          if (null == tBean || null == tvServiceName) {
            ServiceInfoBean tvBean = tvList.get(0);

            serviceId = tvBean.getServiceId();
            servicePos = tvBean.getChannelPosition();
            logicalNumber = tvBean.getLogicalNumber();
            serviceName = tvBean.getChannelName();
            serviceType = tvBean.getServiceType();
          } else {
            serviceId = tvServiceId;
            servicePos = tvServicePos;
            logicalNumber = tvNumber;
            serviceName = tvServiceName;
            serviceType = Config.SERVICE_TYPE_TV;
          }
        } else {
          handler.sendEmptyMessage(Config.NO_PROGRAMME);
        }
      }
    }
  }