use of com.android.repository.impl.meta.TypeDetails in project android by JetBrains.
the class SummaryTreeNode method getStatusString.
@Override
public String getStatusString() {
boolean foundSources = false;
boolean foundPlatform = false;
boolean foundUpdate = false;
for (UpdaterTreeNode child : myAllChildren) {
if (child.getInitialState() != PackageNodeModel.SelectedState.NOT_INSTALLED) {
TypeDetails details = ((DetailsTreeNode) child).getPackage().getTypeDetails();
if (details instanceof DetailsTypes.SourceDetailsType) {
foundSources = true;
} else if (details instanceof DetailsTypes.PlatformDetailsType) {
foundPlatform = true;
}
if (child.getInitialState() == PackageNodeModel.SelectedState.MIXED) {
foundUpdate = true;
}
}
}
if (foundUpdate) {
return "Update available";
}
if (foundPlatform && (foundSources || myVersion.getApiLevel() < 14)) {
// APIs before 14 don't have separate sources
return "Installed";
}
if (foundPlatform || foundSources) {
return "Partially installed";
}
return "Not installed";
}
use of com.android.repository.impl.meta.TypeDetails in project android by JetBrains.
the class SdkUpdaterConfigPanel method loadPackages.
private void loadPackages(RepositoryPackages packages) {
Multimap<AndroidVersion, UpdatablePackage> platformPackages = TreeMultimap.create();
Set<UpdatablePackage> toolsPackages = Sets.newTreeSet();
for (UpdatablePackage info : packages.getConsolidatedPkgs().values()) {
RepoPackage p = info.getRepresentative();
TypeDetails details = p.getTypeDetails();
if (details instanceof DetailsTypes.ApiDetailsType) {
platformPackages.put(((DetailsTypes.ApiDetailsType) details).getAndroidVersion(), info);
} else {
toolsPackages.add(info);
}
}
// TODO: when should we show this?
//myChannelLink.setVisible(myHasPreview && !myIncludePreview);
myPlatformComponentsPanel.setPackages(platformPackages);
myToolComponentsPanel.setPackages(toolsPackages);
}
use of com.android.repository.impl.meta.TypeDetails in project android by JetBrains.
the class FormFactorUtils method getTag.
/**
* Return the tag for the specified repository package.
* We are only interested in 2 package types.
*/
@Nullable
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 SystemImageDescription method hasSystemImage.
static boolean hasSystemImage(RepoPackage p) {
TypeDetails details = p.getTypeDetails();
if (!(details instanceof DetailsTypes.ApiDetailsType)) {
return false;
}
int apiLevel = ((DetailsTypes.ApiDetailsType) details).getApiLevel();
if (details instanceof DetailsTypes.SysImgDetailsType) {
return true;
}
// Platforms up to 13 included a bundled system image
if (details instanceof DetailsTypes.PlatformDetailsType && apiLevel <= 13) {
return true;
}
// Google APIs addons up to 19 included a bundled system image
if (details instanceof DetailsTypes.AddonDetailsType && ((DetailsTypes.AddonDetailsType) details).getVendor().getId().equals("google") && AvdWizardUtils.TAGS_WITH_GOOGLE_API.contains(((DetailsTypes.AddonDetailsType) details).getTag()) && apiLevel <= 19) {
return true;
}
return false;
}
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;
}
Aggregations