Search in sources :

Example 1 with TypeDetails

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";
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes)

Example 2 with TypeDetails

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);
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes) AndroidVersion(com.android.sdklib.AndroidVersion)

Example 3 with TypeDetails

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;
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) IdDisplay(com.android.sdklib.repository.IdDisplay) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with TypeDetails

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;
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes)

Example 5 with TypeDetails

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;
}
Also used : TypeDetails(com.android.repository.impl.meta.TypeDetails) IdDisplay(com.android.sdklib.repository.IdDisplay) DetailsTypes(com.android.sdklib.repository.meta.DetailsTypes) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

TypeDetails (com.android.repository.impl.meta.TypeDetails)7 DetailsTypes (com.android.sdklib.repository.meta.DetailsTypes)7 AndroidVersion (com.android.sdklib.AndroidVersion)3 Nullable (org.jetbrains.annotations.Nullable)3 IdDisplay (com.android.sdklib.repository.IdDisplay)2 LocalPackage (com.android.repository.api.LocalPackage)1 RemotePackage (com.android.repository.api.RemotePackage)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1