use of com.android.repository.impl.meta.TypeDetails in project android by JetBrains.
the class AndroidVersionsInfo method getTag.
/**
* Return the tag for the specified repository package.
* We are only interested in 2 package types.
*/
@Nullable
private static IdDisplay getTag(@NotNull RepoPackage repoPackage) {
TypeDetails details = repoPackage.getTypeDetails();
IdDisplay tag = NO_MATCH;
if (details instanceof DetailsTypes.AddonDetailsType) {
tag = ((DetailsTypes.AddonDetailsType) details).getTag();
}
if (details instanceof DetailsTypes.SysImgDetailsType) {
DetailsTypes.SysImgDetailsType imgDetailsType = (DetailsTypes.SysImgDetailsType) details;
if (imgDetailsType.getAbi().equals(SdkConstants.CPU_ARCH_INTEL_ATOM)) {
tag = imgDetailsType.getTag();
}
}
return tag;
}
use of com.android.repository.impl.meta.TypeDetails in project android by JetBrains.
the class InstantRunPositionManager method createSourcesByApiLevel.
private static Map<AndroidVersion, VirtualFile> createSourcesByApiLevel() {
Collection<? extends LocalPackage> sourcePackages = getAllPlatformSourcePackages();
Map<AndroidVersion, VirtualFile> sourcesByApi = Maps.newHashMap();
for (LocalPackage sourcePackage : sourcePackages) {
TypeDetails typeDetails = sourcePackage.getTypeDetails();
if (!(typeDetails instanceof DetailsTypes.ApiDetailsType)) {
Logger.getInstance(InstantRunPositionManager.class).warn("Unable to get type details for source package @ " + sourcePackage.getLocation().getPath());
continue;
}
DetailsTypes.ApiDetailsType details = (DetailsTypes.ApiDetailsType) typeDetails;
AndroidVersion version = details.getAndroidVersion();
VirtualFile sourceFolder = VfsUtil.findFileByIoFile(sourcePackage.getLocation(), true);
if (sourceFolder != null && sourceFolder.isValid()) {
sourcesByApi.put(version, sourceFolder);
}
}
return ImmutableMap.copyOf(sourcesByApi);
}
Aggregations