Beispiel #1
0
 private static void addOrphanedSystemImage(
     ISystemImage image, IPkgDesc desc, Map<MissingTarget, MissingTarget> targets) {
   IdDisplay vendor = desc.getVendor();
   MissingTarget target =
       new MissingTarget(
           vendor == null ? null : vendor.getDisplay(),
           desc.getTag().getDisplay(),
           desc.getAndroidVersion());
   MissingTarget existing = targets.get(target);
   if (existing == null) {
     existing = target;
     targets.put(target, target);
   }
   existing.addSystemImage(image);
 }
Beispiel #2
0
  /**
   * Retrieves information on a package identified by both vendor and path strings.
   *
   * <p>For add-ons the path is target hash string (see {@link AndroidTargetHash} for helpers
   * methods to generate this string.)
   *
   * @param filter {@link PkgType#PKG_EXTRA}, {@link PkgType#PKG_ADDON}.
   * @param vendor The vendor id of the extra package.
   * @param path The path uniquely identifying this package for its vendor.
   * @return An existing package information or null if not found.
   */
  @Nullable
  public LocalPkgInfo getPkgInfo(
      @NonNull PkgType filter, @NonNull String vendor, @NonNull String path) {

    assert filter == PkgType.PKG_EXTRA || filter == PkgType.PKG_ADDON;

    for (LocalPkgInfo pkg : getPkgsInfos(filter)) {
      IPkgDesc d = pkg.getDesc();
      if (d.hasVendor() && vendor.equals(d.getVendor().getId())) {
        if (d.hasPath() && path.equals(d.getPath())) {
          return pkg;
        }
      }
    }
    return null;
  }