Пример #1
0
  private void updateServiceState(ServiceState serviceState) {
    int state = serviceState.getState();
    String display = mRes.getString(R.string.radioInfo_unknown);

    switch (state) {
      case ServiceState.STATE_IN_SERVICE:
        display = mRes.getString(R.string.radioInfo_service_in);
        break;
      case ServiceState.STATE_OUT_OF_SERVICE:
      case ServiceState.STATE_EMERGENCY_ONLY:
        display = mRes.getString(R.string.radioInfo_service_out);
        break;
      case ServiceState.STATE_POWER_OFF:
        display = mRes.getString(R.string.radioInfo_service_off);
        break;
    }

    setSummaryText(KEY_SERVICE_STATE, display);

    if (serviceState.getRoaming()) {
      setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_in));
    } else {
      setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_not));
    }
    Preference p = findPreference(KEY_OPERATOR_NAME);
    String op = serviceState.getOperatorAlphaLong();
    if (TextUtils.isEmpty(op)) {
      op = this.getResources().getString(R.string.device_info_default);
    }
    if (p != null) {
      mExt.updateServiceState(p, serviceState.getOperatorAlphaLong());
    }
  }
Пример #2
0
  private void updateServiceState(ServiceState serviceState) {
    int state = serviceState.getState();
    String display = mRes.getString(R.string.radioInfo_unknown);

    switch (state) {
      case ServiceState.STATE_IN_SERVICE:
        display = mRes.getString(R.string.radioInfo_service_in);
        break;
      case ServiceState.STATE_OUT_OF_SERVICE:
      case ServiceState.STATE_EMERGENCY_ONLY:
        display = mRes.getString(R.string.radioInfo_service_out);
        break;
      case ServiceState.STATE_POWER_OFF:
        display = mRes.getString(R.string.radioInfo_service_off);
        break;
    }

    setSummaryText(KEY_SERVICE_STATE, display);

    if (serviceState.getRoaming()) {
      setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_in));
    } else {
      setSummaryText(KEY_ROAMING_STATE, mRes.getString(R.string.radioInfo_roaming_not));
    }
    setSummaryText(KEY_OPERATOR_NAME, serviceState.getOperatorAlphaLong());
  }
Пример #3
0
  /**
   * Registration point for combined roaming off combined roaming is true when roaming is true and
   * ONS differs SPN
   *
   * @param h handler to notify
   * @param what what code of message when delivered
   * @param obj placed in Message.obj
   */
  public void registerForRoamingOff(Handler h, int what, Object obj) {
    Registrant r = new Registrant(h, what, obj);
    mRoamingOffRegistrants.add(r);

    if (!ss.getRoaming()) {
      r.notifyRegistrant();
    }
  }