protected void setEnabledSupport(boolean _enabled) {
    if (enabled != _enabled) {

      log("Enabled set to " + _enabled);

      if (_enabled) {

        original_limits = adapter.getLimits();

      } else {

        ping_mapper.saveHistory();
      }

      enableOrAlgChanged();

      enabled = _enabled;

      if (speed_tester != null) {

        speed_tester.setContactNumber(enabled ? CONTACT_NUMBER : 0);
      }

      if (!enabled) {

        adapter.setLimits(original_limits, true, provider.getAdjustsDownloadLimits());
      }
    }
  }
  protected void addPingHistory(int rtt, boolean re_base) {
    int x =
        (adapter.getCurrentDataUploadSpeed(SPEED_AVERAGE_PERIOD)
            + adapter.getCurrentProtocolUploadSpeed(SPEED_AVERAGE_PERIOD));
    int y =
        (adapter.getCurrentDataDownloadSpeed(SPEED_AVERAGE_PERIOD)
            + adapter.getCurrentProtocolDownloadSpeed(SPEED_AVERAGE_PERIOD));

    for (int i = 0; i < ping_mappers.length; i++) {

      ping_mappers[i].addPing(x, y, rtt, re_base);
    }

    Iterator it = transient_mappers.iterator();

    while (it.hasNext()) {

      ((SpeedManagerPingMapperImpl) it.next()).addPing(x, y, rtt, re_base);
    }
  }
 public int getCurrentProtocolDownloadSpeed() {
   return (adapter.getCurrentProtocolDownloadSpeed(-1));
 }
 public int getCurrentDataDownloadSpeed() {
   return (adapter.getCurrentDataDownloadSpeed(-1));
 }
  public void setCurrentDownloadLimit(int bytes_per_second) {
    if (enabled) {

      adapter.setCurrentDownloadLimit(bytes_per_second);
    }
  }
 public int getCurrentDownloadLimit() {
   return (adapter.getCurrentDownloadLimit());
 }