Пример #1
0
  /**
   * Fetches all archives available on the known remote sources.
   *
   * <p>Used by {@link UpdaterData#listRemotePackages_NoGUI} and {@link
   * UpdaterData#updateOrInstallAll_NoGUI}.
   *
   * @param includeAll True to list and install all packages, including obsolete ones.
   * @return A list of potential {@link ArchiveInfo} to install.
   */
  private List<ArchiveInfo> getRemoteArchives_NoGUI(boolean includeAll) {
    refreshSources(true);
    getPackageLoader().loadRemoteAddonsList(new NullTaskMonitor(getSdkLog()));

    List<ArchiveInfo> archives;
    SdkUpdaterLogic ul = new SdkUpdaterLogic(this);

    if (includeAll) {
      archives =
          ul.getAllRemoteArchives(getSources(), getLocalSdkParser().getPackages(), includeAll);

    } else {
      archives =
          ul.computeUpdates(
              null /*selectedArchives*/,
              getSources(),
              getLocalSdkParser().getPackages(),
              includeAll);

      ul.addNewPlatforms(archives, getSources(), getLocalSdkParser().getPackages(), includeAll);
    }

    Collections.sort(archives);
    return archives;
  }