@Override public int hashCode() { return getId().hashCode(); }
/** * Gets the default path/unique id for the given addon */ public static String getAddonPath(IdDisplay vendor, AndroidVersion version, IdDisplay name) { return new StringBuilder().append(SdkConstants.FD_ADDONS) .append(RepoPackage.PATH_SEPARATOR) .append("addon-") .append(name.getId()) .append("-") .append(vendor.getId()) .append("-") .append(version.getApiString()) .toString(); }
/** * Returns a string representation for *debug* purposes only, not for UI display. */ @Override public String toString() { return String.format("%1$s [%2$s]", getId(), getDisplay()); }
/** * Gets the default path/unique id for the given system image */ public static String getSysImgPath(IdDisplay vendor, AndroidVersion version, IdDisplay name, String abi) { return new StringBuilder() .append(SdkConstants.FD_SYSTEM_IMAGES) .append(RepoPackage.PATH_SEPARATOR) .append("android-") .append(version.getApiString()) .append(RepoPackage.PATH_SEPARATOR) .append(name.getId()) .append(RepoPackage.PATH_SEPARATOR) .append(abi) .toString(); }
/** * Extracts the tag id & display from the properties. * If missing, uses the "default" tag id. */ @NonNull public static IdDisplay extractTagFromProps(Properties props) { if (props != null) { String tagId = props.getProperty(PkgProps.SYS_IMG_TAG_ID, SystemImage.DEFAULT_TAG.getId()); String tagDisp = props.getProperty(PkgProps.SYS_IMG_TAG_DISPLAY, ""); //$NON-NLS-1$ if (tagDisp == null || tagDisp.isEmpty()) { tagDisp = tagIdToDisplay(tagId); } assert tagId != null; assert tagDisp != null; return IdDisplay.create(tagId, tagDisp); } return SystemImage.DEFAULT_TAG; }
.append(getVendor().getId()) .append('-') .append(getPath()); .append(getName().getId()) .append('-') .append(getVendor().getId()) .append('-') .append(getAndroidVersion().getApiString()); .append(SystemImage.DEFAULT_TAG.equals(getTag()) ? "android" : getTag().getId()) .append('-') .append(getAndroidVersion().getApiString()); .append(SystemImage.DEFAULT_TAG.equals(getTag()) ? "android" : getTag().getId()) .append('-') .append(getVendor().getId()) .append('-') .append(getAndroidVersion().getApiString());
for (int indexEp = -1; indexEp < lenEpOldPaths; indexEp++) { if (sameVendorAndPath( lhs.getVendor().getId(), lhs.getPath(), rhs.getVendor().getId(), indexEp < 0 ? rhs.getPath() : epOldPaths[indexEp])) { return true; for (int indexThis = -1; indexThis < lenThisOldPaths; indexThis++) { if (sameVendorAndPath( lhs.getVendor().getId(), indexThis < 0 ? lhs.getPath() : thisOldPaths[indexThis], rhs.getVendor().getId(), rhs.getPath())) { return true;
/** * Displays the tags & ABIs valid for the given images. */ private void displayTagAbiList(Collection<SystemImage> systemImages, String message) { mSdkLog.info(message); if (!systemImages.isEmpty()) { boolean first = true; for (ISystemImage si : systemImages) { if (!first) { mSdkLog.info(", "); } else { first = false; } mSdkLog.info("%s/%s", si.getTag().getId(), si.getAbiType()); } mSdkLog.info("\n"); } else { mSdkLog.info("no ABIs.\n"); } }
/** * 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; }
values.put(AVD_INI_TAG_ID, tag.getId()); values.put(AVD_INI_TAG_DISPLAY, tag.getDisplay()); values.put(AVD_INI_ABI_TYPE, abiType);
getAndroidVersion().getApiString()), sanitize(SystemImage.DEFAULT_TAG.equals(getTag()) ? "android" : getTag().getId()), + (SystemImage.DEFAULT_TAG.equals(getTag()) ? "android" : getTag().getId()) + '-' + getVendor().getId() + '-' + getAndroidVersion().getApiString(); sanitize(getVendor().getId()), sanitize(getPath())); break;
mSdkLog.info(" Based on: %s\n", versionWithCodename); mSdkLog.info(" Tag/ABI: %s/%s\n", info.getTag().getId(), info.getAbiType());
String path = SdkConstants.FD_EXTRAS; String vendor = desc.getVendor().getId(); if (vendor != null && vendor.length() > 0) { path += RepoPackage.PATH_SEPARATOR + vendor;
SystemImage.DEFAULT_TAG.getId()); String tagDisp = RemotePackageParserUtils .getOptionalXmlString(packageNode, SdkSysImgConstants.ATTR_TAG_DISPLAY);
if (tagIdDisplay != null) { IdDisplay tag = sdkFactory.createIdDisplayType(); tag.setId(tagIdDisplay.getId()); tag.setDisplay(tagIdDisplay.getDisplay()); details.setTag(tag); if (vendorIdDisplay != null) { IdDisplay vendor = sdkFactory.createIdDisplayType(); vendor.setId(vendorIdDisplay.getId()); vendor.setDisplay(vendorIdDisplay.getDisplay()); details.setVendor(vendor); if (vendorIdDisplay != null) { IdDisplay vendor = sdkFactory.createIdDisplayType(); vendor.setId(vendorIdDisplay.getId()); vendor.setDisplay(vendorIdDisplay.getDisplay()); details.setVendor(vendor); if (nameIdDisplay != null) { IdDisplay tag = sdkFactory.createIdDisplayType(); tag.setId(nameIdDisplay.getId()); tag.setDisplay(nameIdDisplay.getDisplay()); details.setTag(tag); if (vendorIdDisplay != null) { IdDisplay vendor = sdkFactory.createIdDisplayType(); vendor.setId(vendorIdDisplay.getId()); vendor.setDisplay(vendorIdDisplay.getDisplay()); details.setVendor(vendor);