Exemplo n.º 1
0
  /**
   * Returns the list of installed packages, parsing them if this has not yet been done.
   *
   * <p>The package list is cached in the {@link LocalSdkParser} and will be reset when {@link
   * #reloadSdk()} is invoked.
   */
  public Package[] getInstalledPackages(ITaskMonitor monitor) {
    LocalSdkParser parser = getLocalSdkParser();

    Package[] packages = parser.getPackages();

    if (packages == null) {
      // load on demand the first time
      packages = parser.parseSdk(getOsSdkRoot(), getSdkManager(), monitor);
    }

    return packages;
  }
Exemplo n.º 2
0
  /**
   * Reloads the SDK content (targets).
   *
   * <p>This also reloads the AVDs in case their status changed.
   *
   * <p>This does not notify the listeners ({@link ISdkChangeListener}).
   */
  public void reloadSdk() {
    // reload SDK
    mSdkManager.reloadSdk(mSdkLog);

    // reload AVDs
    if (mAvdManager != null) {
      try {
        mAvdManager.reloadAvds(mSdkLog);
      } catch (AndroidLocationException e) {
        // FIXME
      }
    }

    mLocalSdkParser.clearPackages();

    // notify listeners
    broadcastOnSdkReload();
  }