public void processDialog() {
    if (null == cDialog) {
      cDialog =
          DialogUtils.twoButtonsDialogCreate(
              ChannelSearchProgress.this,
              getString(R.string.searchNotice),
              new OnClickListener() {

                @Override
                public void onClick(View v) {
                  if (null != cDialog) {
                    cDialog.dismiss();
                  }
                  finish();
                  // CommonUtils.skipActivity(ChannelSearchProgress.this, TVChannelSearch.class,
                  // -1);
                }
              },
              new OnClickListener() {

                @Override
                public void onClick(View v) {
                  if (null != cDialog) {
                    cDialog.dismiss();
                  }
                  finish();
                }
              });
    }
  }
Esempio n. 2
0
  /**
   * <Parser the entrance from launcher.>
   *
   * @see [类、类#方法、类#成员]
   */
  private void parserEntrance() {
    /* Start LinKang, 2013-12-24, Jump to SystemInfoActivity page... */
    if (null != entrance && entrance.equalsIgnoreCase(Config.DVB_SYSTEM_INFO)) {
      CommonUtils.skipActivity(
          SplashActivity.this, SystemInfoActivity.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    /* End LinKang, 2013-12-24, Jump to SystemInfoActivity page... */

    // check if the ota is downloading now...
    // For OTADownloaderService may be force to quit...
    // So here user NativeDownload to get the ota status...
    NativeDownload nativeDownload = new NativeDownload();

    int otaStatus = nativeDownload.downloadGetStatus();

    if (otaStatus == 1) {
      LogUtils.e(
          TAG, "The OTA is in downloading status for nativeDownload.downloadGetStatus() == 1");
      CommonUtils.skipActivity(
          SplashActivity.this, OTADownloaderActivity.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      return;
    } else {
      LogUtils.e(
          TAG, "The OTA is not in downloading status for nativeDownload.downloadGetStatus() != 1");
    }
    // Factory test
    if (entrance.equals(Config.DVB_FACTORY_TEST)) {
      CommonUtils.skipActivity(
          SplashActivity.this, FactoryTest.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Television Programme
    if (entrance.equals(Config.DVB_TV_PROGRAMME)) {
      if (tvList.size() != 0) {
        Bundle tvBundle = packageServiceInfo();
        CommonUtils.skipActivity(
            SplashActivity.this, TVChannelPlay.class, tvBundle, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      } else {
        if (null == searchDialog) {
          searchDialog =
              DialogUtils.twoButtonsDialogCreate(
                  SplashActivity.this,
                  getString(R.string.no_program_auto_search),
                  new OnClickListener() {

                    @Override
                    public void onClick(View v) {
                      if (null != searchDialog) {
                        searchDialog.dismiss();
                      }
                      Bundle bundle = new Bundle();
                      bundle.putInt("SearchMode", Config.Install_Search_Type_eAUTO_SEARCH);
                      CommonUtils.skipActivity(
                          SplashActivity.this,
                          ChannelSearchProgress.class,
                          bundle,
                          Intent.FLAG_ACTIVITY_CLEAR_TOP);
                    }
                  },
                  new OnClickListener() {

                    @Override
                    public void onClick(View v) {
                      if (null != searchDialog) {
                        searchDialog.dismiss();
                      }
                    }
                  });
        }
      }
    }

    // Radio programme
    else if (entrance.equals(Config.DVB_RADIO_PROGRAMME)) {
      if (radioList.size() != 0) {
        Bundle radioInfos = packageServiceInfo();
        CommonUtils.skipActivity(
            SplashActivity.this, TVChannelPlay.class, radioInfos, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      } else {
        handler.sendEmptyMessage(Config.NO_PROGRAMME);
      }
    }
    // Epg
    else if (entrance.equals(Config.DVB_EPG)) {
      if (tvList.size() != 0 || radioList.size() != 0) {
        Bundle epgInfos = packageServiceInfo();

        Bundle bundle = getIntent().getExtras();

        if (null == bundle) {
          LogUtils.e(TAG, "SplashActivity.onKeyDown:: Epg bundle == null");

          epgInfos.putChar(Config.DVB_SERVICE_TYPE, Config.SERVICE_TYPE_NOTYPE);
        } else {
          char mServiceType = bundle.getChar(Config.DVB_SERVICE_TYPE);

          if (mServiceType != Config.SERVICE_TYPE_TV && mServiceType != Config.SERVICE_TYPE_RADIO) {
            mServiceType = Config.SERVICE_TYPE_NOTYPE;
          }

          epgInfos.putChar(Config.DVB_SERVICE_TYPE, mServiceType);
        }

        CommonUtils.skipActivity(
            SplashActivity.this, EpgActivity.class, epgInfos, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      } else {
        handler.sendEmptyMessage(Config.NO_PROGRAMME);
      }
    }
    // EIT
    else if (entrance.equals(Config.DVB_EIT)) {
      if (tvList.size() != 0 || radioList.size() != 0) {
        Bundle epgInfos = packageServiceInfo();

        Bundle bundle = getIntent().getExtras();

        if (null == bundle) {
          LogUtils.e(TAG, "SplashActivity.onKeyDown:: Eit bundle == null");

          epgInfos.putChar(Config.DVB_SERVICE_TYPE, Config.SERVICE_TYPE_NOTYPE);
        } else {
          char mServiceType = bundle.getChar(Config.DVB_SERVICE_TYPE);

          if (mServiceType != Config.SERVICE_TYPE_TV && mServiceType != Config.SERVICE_TYPE_RADIO) {
            mServiceType = Config.SERVICE_TYPE_NOTYPE;
          }

          epgInfos.putChar(Config.DVB_SERVICE_TYPE, mServiceType);
        }

        CommonUtils.skipActivity(
            SplashActivity.this, EitActivity.class, epgInfos, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      } else {
        handler.sendEmptyMessage(Config.NO_PROGRAMME);
      }
    }
    // Search channels
    else if (entrance.equals(Config.DVB_CHANNEL_SEARCH)) {
      CommonUtils.skipActivity(
          SplashActivity.this, TVChannelSearch.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // direct auto search
    else if (entrance.equals(Config.DVB_DIRECT_SEARCH)) {
      Bundle bundle = new Bundle();
      bundle.putInt("SearchMode", Config.Install_Search_Type_eAUTO_SEARCH);
      CommonUtils.skipActivity(
          SplashActivity.this, ChannelSearchProgress.class, bundle, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // all search
    else if (entrance.equals(Config.DVB_ALL_SEARCH)) {
      Bundle bundle = new Bundle();
      bundle.putInt("SearchMode", Config.Install_Search_Type_eALL_SEARCH);
      CommonUtils.skipActivity(
          SplashActivity.this, ChannelSearchProgress.class, bundle, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    } else if (entrance.equals(Config.DVB_FREQ_SETTING)) {
      CommonUtils.skipActivity(
          SplashActivity.this, SearchFreqSettings.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    } else if (entrance.equals(Config.DVB_BOOT_DEFAULT_CHANNEL)) {
      CommonUtils.skipActivity(
          SplashActivity.this, BootDefaultServiceActivity.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Edit channels
    else if (entrance.equals(Config.DVB_CHANNEL_EDIT)) {
      if (tvList.size() != 0 || radioList.size() != 0) {
        Bundle editInfos = packageServiceInfo();
        CommonUtils.skipActivity(
            SplashActivity.this, TVChannelEdit.class, editInfos, Intent.FLAG_ACTIVITY_CLEAR_TOP);
      } else {
        handler.sendEmptyMessage(Config.NO_PROGRAMME);
      }
    }
    // pvr list
    else if (entrance.equals(Config.DVB_PVR_LIST)) {
      CommonUtils.skipActivity(
          SplashActivity.this, PvrOrderList.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    } else if (entrance.equals(Config.DVB_PVR_PLAY_LIST)) {
      CommonUtils.skipActivity(
          SplashActivity.this, PvrPlayList.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca status
    else if (entrance.equals(Config.DVB_CA_STATUS)) {
      CommonUtils.skipActivity(
          SplashActivity.this, CaStateInfo.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca password settings
    else if (entrance.equals(Config.DVB_CA_PWD_SETTINGS)) {
      CommonUtils.skipActivity(
          SplashActivity.this, CaPasswordSet.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca adult grade
    else if (entrance.equals(Config.DVB_CA_GRADE)) {
      CommonUtils.skipActivity(
          SplashActivity.this, CaRateControl.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca auth
    else if (entrance.equals(Config.DVB_CA_AUTH)) {
      CommonUtils.skipActivity(
          SplashActivity.this, CaAuthInfo.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca email
    else if (entrance.equals(Config.DVB_CA_EMAIL)) {
      CommonUtils.skipActivity(SplashActivity.this, CaEmail.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
    // Ca zimu card feeding
    else if (entrance.equals(Config.DVB_CA_USER_VIEW)) {
      CommonUtils.skipActivity(
          SplashActivity.this, PlayControlMain.class, Intent.FLAG_ACTIVITY_CLEAR_TOP);
    }
  }