Search in sources :

Example 1 with SystemImage

use of com.android.sdklib.repository.targets.SystemImage in project android by JetBrains.

the class AndroidVirtualDevice method getSystemImageDescription.

private SystemImageDescription getSystemImageDescription(AndroidSdkHandler sdkHandler) throws WizardException {
    StudioLoggerProgressIndicator progress = new StudioLoggerProgressIndicator(getClass());
    Collection<SystemImage> systemImages = sdkHandler.getSystemImageManager(progress).lookup(ID_ADDON_GOOGLE_API_IMG, myLatestVersion, ID_VENDOR_GOOGLE);
    if (systemImages.isEmpty()) {
        throw new WizardException("Missing system image required for an AVD setup");
    }
    return new SystemImageDescription(systemImages.iterator().next());
}
Also used : StudioLoggerProgressIndicator(com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator) SystemImage(com.android.sdklib.repository.targets.SystemImage) SystemImageDescription(com.android.tools.idea.avdmanager.SystemImageDescription)

Example 2 with SystemImage

use of com.android.sdklib.repository.targets.SystemImage in project android by JetBrains.

the class AvdManagerConnection method getSystemImageUpdates.

/**
   * The qemu2 emulator has changes in the system images for platform 22 and 23 (Intel CPU architecture only).
   * This method will generate package updates if we detect that we have outdated system images for platform
   * 22 and 23. We also check the addon system images which includes the Google API.
   * @return a list of package paths that need to be updated.
   */
@NotNull
public List<String> getSystemImageUpdates() {
    List<String> requested = Lists.newArrayList();
    SystemImageUpdateDependency[] dependencies = getSystemImageUpdateDependencies();
    if (dependencies == null) {
        return requested;
    }
    assert mySdkHandler != null;
    for (SystemImage systemImage : mySdkHandler.getSystemImageManager(REPO_LOG).getImages()) {
        for (SystemImageUpdateDependency dependency : dependencies) {
            if (dependency.updateRequired(systemImage)) {
                requested.add(systemImage.getPackage().getPath());
                break;
            }
        }
    }
    return requested;
}
Also used : ISystemImage(com.android.sdklib.ISystemImage) SystemImage(com.android.sdklib.repository.targets.SystemImage) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SystemImage (com.android.sdklib.repository.targets.SystemImage)2 ISystemImage (com.android.sdklib.ISystemImage)1 SystemImageDescription (com.android.tools.idea.avdmanager.SystemImageDescription)1 StudioLoggerProgressIndicator (com.android.tools.idea.sdk.progress.StudioLoggerProgressIndicator)1 NotNull (org.jetbrains.annotations.NotNull)1