Ejemplo n.º 1
0
  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());
      }
    }
  }
Ejemplo n.º 2
0
  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);
    }
  }
Ejemplo n.º 3
0
 public int getCurrentProtocolDownloadSpeed() {
   return (adapter.getCurrentProtocolDownloadSpeed(-1));
 }
Ejemplo n.º 4
0
 public int getCurrentDataDownloadSpeed() {
   return (adapter.getCurrentDataDownloadSpeed(-1));
 }
Ejemplo n.º 5
0
  public void setCurrentDownloadLimit(int bytes_per_second) {
    if (enabled) {

      adapter.setCurrentDownloadLimit(bytes_per_second);
    }
  }
Ejemplo n.º 6
0
 public int getCurrentDownloadLimit() {
   return (adapter.getCurrentDownloadLimit());
 }