diff options
20 files changed, 471 insertions, 142 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java index 6388644..2a1fba9 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java @@ -19,6 +19,7 @@ package com.android.ide.eclipse.adt.internal.sdk; import static com.android.ide.eclipse.adt.AdtConstants.DOT_XML; import static com.android.sdklib.SdkConstants.FD_RES; +import com.android.annotations.NonNull; import com.android.ddmlib.IDevice; import com.android.ide.common.rendering.LayoutLibrary; import com.android.ide.common.sdk.LoadStatus; @@ -303,6 +304,25 @@ public final class Sdk { } /** + * Returns a <em>new</em> {@link SdkManager} that can parse the SDK located + * at the current {@link #getSdkLocation()}. + * <p/> + * Implementation detail: The {@link Sdk} has its own internal manager with + * a custom logger which is not designed to be useful for outsiders. Callers + * who need their own {@link SdkManager} for parsing will often want to control + * the logger for their own need. + * <p/> + * This is just a convenient method equivalent to writing: + * <pre>SdkManager.createManager(Sdk.getCurrent().getSdkLocation(), log);</pre> + * + * @param log The logger for the {@link SdkManager}. + * @return A new {@link SdkManager} parsing the same location. + */ + public @NonNull SdkManager getNewSdkManager(@NonNull ISdkLog log) { + return SdkManager.createManager(getSdkLocation(), log); + } + + /** * Returns the URL to the local documentation. * Can return null if no documentation is found in the current SDK. * diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizardState.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizardState.java index 33f9884..264f09d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizardState.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectWizardState.java @@ -26,6 +26,7 @@ import com.android.sdklib.internal.project.ProjectProperties.PropertyType; import com.android.sdklib.xml.AndroidManifest; import com.android.sdklib.xml.ManifestData; import com.android.sdklib.xml.ManifestData.Activity; +import com.android.util.Pair; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.Path; @@ -94,14 +95,12 @@ public class NewProjectWizardState { public String minSdk; /** True if the minimum SDK version has been manually edited by the user */ public boolean minSdkModifiedByUser; - /** - * The directory where the samples are found. This field is only applicable - * when the wizard is running in create-sample-mode. - */ - public File samplesDir; - /** A list of paths to each of the available samples for the current SDK */ - public List<File> samples = new ArrayList<File>(); + * A list of paths to each of the available samples for the current SDK. + * The pair is (String: sample display name => File: sample directory). + * Note we want a list, not a map since we might have duplicates. + * */ + public List<Pair<String, File>> samples = new ArrayList<Pair<String, File>>(); /** Path to the currently chosen sample */ public File chosenSample; @@ -396,4 +395,4 @@ public class NewProjectWizardState { */ ANY; } -}
\ No newline at end of file +} diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java index d54697f..ef16d3d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SampleSelectionPage.java @@ -18,6 +18,7 @@ package com.android.ide.eclipse.adt.internal.wizards.newproject; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode; import com.android.sdklib.IAndroidTarget; +import com.android.util.Pair; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; @@ -43,7 +44,6 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; import java.io.File; -import java.util.regex.Pattern; /** Page where the user can select a sample to "instantiate" */ class SampleSelectionPage extends WizardPage implements SelectionListener, ModifyListener { @@ -125,21 +125,11 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif @Override public String getText(Object element) { - File file = (File) element; - String path = file.getPath(); - int n = mValues.samplesDir.getPath().length(); - if (path.length() > n) { - path = path.substring(n); - if (path.charAt(0) == File.separatorChar) { - path = path.substring(1); - } - if (path.endsWith(File.separator)) { - path = path.substring(0, path.length() - 1); - } - path = path.replaceAll(Pattern.quote(File.separator), " > "); + if (element instanceof Pair<?, ?>) { + Object name = ((Pair<?, ?>) element).getFirst(); + return name.toString(); } - - return path; + return element.toString(); // Fallback. Should not happen. } }; @@ -151,7 +141,7 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif mTableViewer.setInput(samples); mTable.select(0); - selectSample(mValues.samples.get(0)); + selectSample(mValues.samples.get(0).getSecond()); extractNamesFromAndroidManifest(); } } @@ -170,6 +160,7 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif } } + @SuppressWarnings("unchecked") @Override public void widgetSelected(SelectionEvent e) { if (mIgnore) { @@ -181,7 +172,7 @@ class SampleSelectionPage extends WizardPage implements SelectionListener, Modif int index = mTable.getSelectionIndex(); if (index >= 0) { Object[] roots = (Object[]) mTableViewer.getInput(); - selectSample((File) roots[index]); + selectSample(((Pair<String, File>) roots[index]).getSecond()); } else { selectSample(null); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java index 11d0e95..2713f01 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/SdkSelectionPage.java @@ -15,17 +15,25 @@ */ package com.android.ide.eclipse.adt.internal.wizards.newproject; +import com.android.annotations.Nullable; import com.android.ide.common.sdk.LoadStatus; import com.android.ide.eclipse.adt.AdtPlugin; import com.android.ide.eclipse.adt.internal.sdk.Sdk; import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener; import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode; +import com.android.io.FileWrapper; import com.android.sdklib.AndroidVersion; import com.android.sdklib.IAndroidTarget; +import com.android.sdklib.NullSdkLog; import com.android.sdklib.SdkConstants; +import com.android.sdklib.SdkManager; +import com.android.sdklib.xml.AndroidManifestParser; +import com.android.sdklib.xml.ManifestData; import com.android.sdkuilib.internal.widgets.SdkTargetSelector; +import com.android.util.Pair; import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; @@ -38,7 +46,11 @@ import org.eclipse.swt.widgets.Group; import java.io.File; import java.util.Collections; +import java.util.Comparator; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Pattern; /** A page in the New Project wizard where you select the target SDK */ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { @@ -196,21 +208,43 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { // Get the sample root path and recompute the list of samples String samplesRootPath = target.getPath(IAndroidTarget.SAMPLES); - mValues.samplesDir = new File(samplesRootPath); - findSamplesManifests(mValues.samplesDir, mValues.samples); + File root = new File(samplesRootPath); + findSamplesManifests(root, root, null, null, mValues.samples); + + Sdk sdk = Sdk.getCurrent(); + if (sdk != null) { + // Parse the extras to see if we can find samples that are + // compatible with the selected target API. + // First we need an SdkManager that suppresses all output. + SdkManager sdkman = sdk.getNewSdkManager(new NullSdkLog()); + + Map<File, String> extras = sdkman.getExtraSamples(); + for (Entry<File, String> entry : extras.entrySet()) { + File path = entry.getKey(); + String name = entry.getValue(); + findSamplesManifests(path, path, name, + target.getVersion(), + mValues.samples); + } + } - if (mValues.samples.size() == 0) { + if (mValues.samples.isEmpty()) { return; } else { - Collections.sort(mValues.samples); + Collections.sort(mValues.samples, new Comparator<Pair<String, File>>() { + @Override + public int compare(Pair<String, File> o1, Pair<String, File> o2) { + // Compare the display name of the sample + return o1.getFirst().compareTo(o2.getFirst()); + } + }); } - // Recompute the description of each sample (the relative path - // to the sample root). Also try to find the old selection. + // Try to find the old selection. if (previouslyChosenSample != null) { String previouslyChosenName = previouslyChosenSample.getName(); for (int i = 0, n = mValues.samples.size(); i < n; i++) { - File file = mValues.samples.get(i); + File file = mValues.samples.get(i).getSecond(); if (file.getName().equals(previouslyChosenName)) { mValues.chosenSample = file; break; @@ -224,18 +258,61 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { * Recursively find potential sample directories under the given directory. * Actually lists any directory that contains an android manifest. * Paths found are added the samplesPaths list. + * + * @param rootDir The "samples" root directory. Doesn't change during recursion. + * @param currDir The directory being scanned. Caller must initially set it to {@code rootDir}. + * @param extraName Optional name appended to the samples display name. Typically used to + * indicate a sample comes from a given extra package. + * @param targetVersion Optional target version filter. If non null, only samples that are + * compatible with the given target will be listed. + * @param samplesPaths A non-null list filled by this method with all samples found. The + * pair is (String: sample display name => File: sample directory). */ - private void findSamplesManifests(File samplesDir, List<File> samplesPaths) { - if (!samplesDir.isDirectory()) { + private void findSamplesManifests( + File rootDir, + File currDir, + @Nullable String extraName, + @Nullable AndroidVersion targetVersion, + List<Pair<String, File>> samplesPaths) { + if (!currDir.isDirectory()) { return; } - for (File f : samplesDir.listFiles()) { + for (File f : currDir.listFiles()) { if (f.isDirectory()) { // Assume this is a sample if it contains an android manifest. File manifestFile = new File(f, SdkConstants.FN_ANDROID_MANIFEST_XML); if (manifestFile.isFile()) { - samplesPaths.add(f); + try { + ManifestData data = + AndroidManifestParser.parse(new FileWrapper(manifestFile)); + if (data != null) { + boolean accept = false; + if (targetVersion == null) { + accept = true; + } else if (targetVersion != null) { + int i = data.getMinSdkVersion(); + if (i != ManifestData.MIN_SDK_CODENAME) { + accept = i <= targetVersion.getApiLevel(); + } else { + String s = data.getMinSdkVersionString(); + if (s != null) { + accept = s.equals(targetVersion.getCodename()); + } + } + } + + if (accept) { + String name = getSampleDisplayName(extraName, rootDir, f); + samplesPaths.add(Pair.of(name, f)); + } + } + } catch (Exception e) { + // Ignore. Don't use a sample which manifest doesn't parse correctly. + AdtPlugin.log(IStatus.INFO, + "NPW ignoring malformed manifest %s", //$NON-NLS-1$ + manifestFile.getAbsolutePath()); + } } // Recurse in the project, to find embedded tests sub-projects @@ -245,12 +322,35 @@ class SdkSelectionPage extends WizardPage implements ITargetChangeListener { if (!SdkConstants.FD_SOURCES.equals(leaf) && !SdkConstants.FD_ASSETS.equals(leaf) && !SdkConstants.FD_RES.equals(leaf)) { - findSamplesManifests(f, samplesPaths); + findSamplesManifests(rootDir, f, extraName, targetVersion, samplesPaths); } } } } + /** + * Compute the sample name compared to its root directory. + */ + private String getSampleDisplayName(String extraName, File rootDir, File sampleDir) { + String path = sampleDir.getPath(); + int n = rootDir.getPath().length(); + if (path.length() > n) { + path = path.substring(n); + if (path.charAt(0) == File.separatorChar) { + path = path.substring(1); + } + if (path.endsWith(File.separator)) { + path = path.substring(0, path.length() - 1); + } + path = path.replaceAll(Pattern.quote(File.separator), " > "); //$NON-NLS-1$ + } + if (extraName != null) { + path = path + " [" + extraName + ']'; //$NON-NLS-1$ + } + + return path; + } + private void validatePage() { String error = null; diff --git a/files/proguard-android.txt b/files/proguard-android.txt index b3d2fe1..6613823 100644 --- a/files/proguard-android.txt +++ b/files/proguard-android.txt @@ -31,6 +31,8 @@ -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgent -keep public class * extends android.preference.Preference +-keep public class * extends android.support.v4.app.Fragment +-keep public class * extends android.app.Fragment -keep public class com.android.vending.licensing.ILicensingService # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java index 306e6a2..3163a6c 100644 --- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java +++ b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java @@ -154,7 +154,11 @@ public class ApiLookup { if (cacheDir == null) { cacheDir = xmlFile.getParentFile(); } - File binaryData = new File(cacheDir, name + ".bin"); + + File binaryData = new File(cacheDir, name + // Incorporate version number in the filename to avoid upgrade filename + // conflicts on Windows (such as issue #26663) + + "-" + BINARY_FORMAT_VERSION + ".bin"); //$NON-NLS-1$ //$NON-NLS-2$ if (DEBUG_FORCE_REGENERATE_BINARY) { System.err.println("\nTemporarily regenerating binary data unconditionally \nfrom " diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java index da66e64..59ed9c6 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java @@ -61,7 +61,8 @@ public interface ISystemImage extends Comparable<ISystemImage> { /** * Returns the ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI}, - * {@link SdkConstants#ABI_ARMEABI_V7A} or {@link SdkConstants#ABI_INTEL_ATOM}. + * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or + * {@link SdkConstants#ABI_MIPS}. * Cannot be null nor empty. */ public abstract String getAbiType(); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java index e21e14f..ebdc9c8 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java @@ -229,9 +229,11 @@ public final class SdkConstants { public final static String ABI_ARMEABI = "armeabi"; //$NON-NLS-1$ public final static String ABI_ARMEABI_V7A = "armeabi-v7a"; //$NON-NLS-1$ public final static String ABI_INTEL_ATOM = "x86"; //$NON-NLS-1$ + public final static String ABI_MIPS = "mips"; //$NON-NLS-1$ /** Name of the CPU arch to support. */ public final static String CPU_ARCH_ARM = "arm"; //$NON-NLS-1$ public final static String CPU_ARCH_INTEL_ATOM = "x86"; //$NON-NLS-1$ + public final static String CPU_ARCH_MIPS = "mips"; //$NON-NLS-1$ /** Name of the CPU model to support. */ public final static String CPU_MODEL_CORTEX_A8 = "cortex-a8"; //$NON-NLS-1$ diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java index df3defc..fb7f0bf 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java @@ -16,6 +16,7 @@ package com.android.sdklib; +import com.android.annotations.NonNull; import com.android.annotations.VisibleForTesting; import com.android.annotations.VisibleForTesting.Visibility; import com.android.io.FileWrapper; @@ -24,6 +25,11 @@ import com.android.prefs.AndroidLocation.AndroidLocationException; import com.android.sdklib.AndroidVersion.AndroidVersionException; import com.android.sdklib.ISystemImage.LocationType; import com.android.sdklib.internal.project.ProjectProperties; +import com.android.sdklib.internal.repository.Archive; +import com.android.sdklib.internal.repository.ExtraPackage; +import com.android.sdklib.internal.repository.LocalSdkParser; +import com.android.sdklib.internal.repository.NullTaskMonitor; +import com.android.sdklib.internal.repository.Package; import com.android.sdklib.repository.PkgProps; import com.android.util.Pair; @@ -149,8 +155,8 @@ public class SdkManager { manager.setTargets(list.toArray(new IAndroidTarget[list.size()])); - // load the samples, after the targets have been set. - manager.loadSamples(log); + // Initialize the targets' sample paths, after the targets have been set. + manager.initializeSamplePaths(log); return manager; } catch (IllegalArgumentException e) { @@ -260,7 +266,7 @@ public class SdkManager { setTargets(list.toArray(new IAndroidTarget[list.size()])); // load the samples, after the targets have been set. - loadSamples(log); + initializeSamplePaths(log); } /** @@ -272,7 +278,7 @@ public class SdkManager { * version defined. * * @return The greatest {@link LayoutlibVersion} or null if none is found. - * @deprecated This does NOT solve the right problem and will be changed in Tools R15. + * @deprecated This does NOT solve the right problem and will be changed later. */ @Deprecated public LayoutlibVersion getMaxLayoutlibVersion() { @@ -293,6 +299,43 @@ public class SdkManager { } /** + * Returns a map of the <em>root samples directories</em> located in the SDK/extras packages. + * No guarantee is made that the extras' samples directory actually contain any valid samples. + * The only guarantee is that the root samples directory actually exists. + * The map is { File: Samples root directory => String: Extra package display name. } + * + * @return A non-null possibly empty map of extra samples directories and their associated + * extra package display name. + */ + public @NonNull Map<File, String> getExtraSamples() { + LocalSdkParser parser = new LocalSdkParser(); + Package[] packages = parser.parseSdk(mOsSdkPath, + this, + LocalSdkParser.PARSE_EXTRAS, + new NullTaskMonitor(new NullSdkLog())); + + Map<File, String> samples = new HashMap<File, String>(); + + for (Package pkg : packages) { + if (pkg instanceof ExtraPackage && pkg.isLocal()) { + // isLocal()==true implies there's a single locally-installed archive. + assert pkg.getArchives() != null && pkg.getArchives().length == 1; + Archive a = pkg.getArchives()[0]; + assert a != null; + File path = new File(a.getLocalOsPath(), SdkConstants.FD_SAMPLES); + if (path.isDirectory()) { + samples.put(path, pkg.getListDescription()); + } + } + } + + return samples; + } + + + // -------- private methods ---------- + + /** * Loads the Platforms from the SDK. * Creates the "platforms" folder if necessary. * @@ -994,11 +1037,15 @@ public class SdkManager { } /** - * Loads all samples from the {@link SdkConstants#FD_SAMPLES} directory. + * Initialize the sample folders for all known targets (platforms and addons). + * <p/> + * Samples used to be located at SDK/Target/samples. We then changed this to + * have a separate SDK/samples/samples-API directory. This parses either directories + * and sets the targets' sample path accordingly. * * @param log Logger. Cannot be null. */ - private void loadSamples(ISdkLog log) { + private void initializeSamplePaths(ISdkLog log) { File sampleFolder = new File(mOsSdkPath, SdkConstants.FD_SAMPLES); if (sampleFolder.isDirectory()) { File[] platforms = sampleFolder.listFiles(); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java index c4957e0..e9a8c57 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java @@ -40,7 +40,8 @@ public class SystemImage implements ISystemImage { * @param location The location of an installed system image. * @param locationType Where the system image folder is located for this ABI. * @param abiType The ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI}, - * {@link SdkConstants#ABI_ARMEABI_V7A} or {@link SdkConstants#ABI_INTEL_ATOM}. + * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or + * {@link SdkConstants#ABI_MIPS}. */ public SystemImage(File location, LocationType locationType, String abiType) { mLocation = location; @@ -55,7 +56,8 @@ public class SystemImage implements ISystemImage { * @param sdkManager The current SDK manager. * @param locationType Where the system image folder is located for this ABI. * @param abiType The ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI}, - * {@link SdkConstants#ABI_ARMEABI_V7A} or {@link SdkConstants#ABI_INTEL_ATOM}. + * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or + * {@link SdkConstants#ABI_MIPS}. * @throws IllegalArgumentException if the {@code target} used for * {@link ISystemImage.LocationType#IN_SYSTEM_IMAGE} is not a {@link PlatformTarget}. */ @@ -135,7 +137,8 @@ public class SystemImage implements ISystemImage { /** * Returns the ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI}, - * {@link SdkConstants#ABI_ARMEABI_V7A} or {@link SdkConstants#ABI_INTEL_ATOM}. + * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or + * {@link SdkConstants#ABI_MIPS}. * Cannot be null nor empty. */ @Override diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java index 78c069a..463037e 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java @@ -152,6 +152,9 @@ public final class AvdInfo implements Comparable<AvdInfo> { } else if (raw.equalsIgnoreCase(SdkConstants.ABI_INTEL_ATOM)) { s = "Intel Atom (" + SdkConstants.ABI_INTEL_ATOM + ")"; + } else if (raw.equalsIgnoreCase(SdkConstants.ABI_MIPS)) { + s = "Mips (" + SdkConstants.ABI_MIPS + ")"; + } else { s = raw + " (" + raw + ")"; } diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java index db3cc33..dc19287 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java @@ -609,6 +609,8 @@ public class AvdManager { values.put(AVD_INI_CPU_MODEL, SdkConstants.CPU_MODEL_CORTEX_A8); } else if (SdkConstants.ABI_INTEL_ATOM.equals(abiType)) { values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_INTEL_ATOM); + } else if (SdkConstants.ABI_MIPS.equals(abiType)) { + values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_MIPS); } else { log.error(null, "ABI %1$s is not supported by this version of the SDK Tools", abiType); diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java index a64d151..2c78cd1 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java @@ -210,31 +210,36 @@ public class DocPackage extends Package implements IPackageVersion { return new File(osSdkRoot, SdkConstants.FD_DOCS);
}
+ /**
+ * Consider doc packages to be the same if they cover the same API level,
+ * regardless of their revision number.
+ */
@Override
public boolean sameItemAs(Package pkg) {
- // only one doc package so any doc package is the same item
- // and we explicitly don't check whether the version is the same.
- return pkg instanceof DocPackage;
+ if (pkg instanceof DocPackage) {
+ AndroidVersion rev2 = ((DocPackage) pkg).getVersion();
+ return this.getVersion().equals(rev2);
+ }
+
+ return false;
}
/**
* {@inheritDoc}
- *
- * The comparison between doc packages is a bit more complex so we override the default
- * implementation.
- * <p/>
- * Docs are upgrade if they have a higher api, or a similar api but a higher revision.
+ * <hr>
+ * Doc packages are a bit different since there can only be one doc installed at
+ * the same time.
* <p/>
- * What makes this more complex is handling codename.
+ * We now consider that docs for different APIs are NOT updates, e.g. doc for API N+1
+ * is no longer considered an update for doc API N.
+ * However docs that have the same API version (API level + codename) are considered
+ * updates if they have a higher revision number (so 15 rev 2 is an update for 15 rev 1,
+ * but is not an update for 14 rev 1.)
*/
@Override
public UpdateInfo canBeUpdatedBy(Package replacementPackage) {
- if (replacementPackage == null) {
- return UpdateInfo.INCOMPATIBLE;
- }
-
- // check they are the same item.
- if (sameItemAs(replacementPackage) == false) {
+ // check they are the same kind of object
+ if (!(replacementPackage instanceof DocPackage)) {
return UpdateInfo.INCOMPATIBLE;
}
@@ -242,11 +247,6 @@ public class DocPackage extends Package implements IPackageVersion { AndroidVersion replacementVersion = replacementDoc.getVersion();
- // the new doc is an update if the api level is higher (no matter the codename on either)
- if (replacementVersion.getApiLevel() > mVersion.getApiLevel()) {
- return UpdateInfo.UPDATE;
- }
-
// Check if they're the same exact (api and codename)
if (replacementVersion.equals(mVersion)) {
// exact same version, so check the revision level
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java index a242c26..4e922c5 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ExtraPackage.java @@ -552,6 +552,7 @@ public class ExtraPackage extends MinToolsPackage Package[] pkgs = localParser.parseSdk(
osSdkRoot,
sdkManager,
+ LocalSdkParser.PARSE_EXTRAS,
new NullTaskMonitor(new NullSdkLog()));
for (Package pkg : pkgs) {
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java index 13be219..29ea5ff 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java @@ -16,6 +16,7 @@ package com.android.sdklib.internal.repository;
+import com.android.annotations.NonNull;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.ISdkLog;
import com.android.sdklib.ISystemImage;
@@ -42,6 +43,33 @@ public class LocalSdkParser { private Package[] mPackages;
+ /** Parse all SDK folders. */
+ public static final int PARSE_ALL = 0xFFFF;
+ /** Parse the SDK/tools folder. */
+ public static final int PARSE_TOOLS = 0x0001;
+ /** Parse the SDK/platform-tools folder */
+ public static final int PARSE_PLATFORM_TOOLS = 0x0002;
+ /** Parse the SDK/docs folder. */
+ public static final int PARSE_DOCS = 0x0004;
+ /**
+ * Equivalent to parsing the SDK/platforms folder but does so
+ * by using the <em>valid</em> targets loaded by the {@link SdkManager}.
+ * Parsing the platforms also parses the SDK/system-images folder.
+ */
+ public static final int PARSE_PLATFORMS = 0x0010;
+ /**
+ * Equivalent to parsing the SDK/addons folder but does so
+ * by using the <em>valid</em> targets loaded by the {@link SdkManager}.
+ */
+ public static final int PARSE_ADDONS = 0x0020;
+ /** Parse the SDK/samples folder.
+ * Note: this will not detect samples located in the SDK/extras packages. */
+ public static final int PARSE_SAMPLES = 0x0100;
+ /** Parse the SDK/sources folder. */
+ public static final int PARSE_SOURCES = 0x0200;
+ /** Parse the SDK/extras folder. */
+ public static final int PARSE_EXTRAS = 0x0400;
+
public LocalSdkParser() {
// pass
}
@@ -69,115 +97,165 @@ public class LocalSdkParser { * <p/>
* Store the packages internally. You can use {@link #getPackages()} to retrieve them
* at any time later.
+ * <p/>
+ * Equivalent to calling {@code parseSdk(..., PARSE_ALL, ...); }
+ *
+ * @param osSdkRoot The path to the SDK folder, typically {@code sdkManager.getLocation()}.
+ * @param sdkManager An existing SDK manager to list current platforms and addons.
+ * @param monitor A monitor to track progress. Cannot be null.
+ * @return The packages found. Can be retrieved later using {@link #getPackages()}.
+ */
+ public @NonNull Package[] parseSdk(
+ @NonNull String osSdkRoot,
+ @NonNull SdkManager sdkManager,
+ @NonNull ITaskMonitor monitor) {
+ return parseSdk(osSdkRoot, sdkManager, PARSE_ALL, monitor);
+ }
+
+ /**
+ * Scan the give SDK to find all the packages already installed at this location.
+ * <p/>
+ * Store the packages internally. You can use {@link #getPackages()} to retrieve them
+ * at any time later.
*
* @param osSdkRoot The path to the SDK folder, typically {@code sdkManager.getLocation()}.
* @param sdkManager An existing SDK manager to list current platforms and addons.
+ * @param parseFilter Either {@link #PARSE_ALL} or an ORed combination of the other
+ * {@code PARSE_} constants to indicate what should be parsed.
* @param monitor A monitor to track progress. Cannot be null.
* @return The packages found. Can be retrieved later using {@link #getPackages()}.
*/
- public Package[] parseSdk(
- String osSdkRoot,
- SdkManager sdkManager,
- ITaskMonitor monitor) {
+ public @NonNull Package[] parseSdk(
+ @NonNull String osSdkRoot,
+ @NonNull SdkManager sdkManager,
+ int parseFilter,
+ @NonNull ITaskMonitor monitor) {
ArrayList<Package> packages = new ArrayList<Package>();
HashSet<File> visited = new HashSet<File>();
monitor.setProgressMax(10);
- File dir = new File(osSdkRoot, SdkConstants.FD_DOCS);
- Package pkg = scanDoc(dir, monitor);
- if (pkg != null) {
- packages.add(pkg);
- visited.add(dir);
+ File dir = null;
+ Package pkg = null;
+
+ if ((parseFilter & PARSE_DOCS) != 0) {
+ dir = new File(osSdkRoot, SdkConstants.FD_DOCS);
+ pkg = scanDoc(dir, monitor);
+ if (pkg != null) {
+ packages.add(pkg);
+ visited.add(dir);
+ }
}
monitor.incProgress(1);
- dir = new File(osSdkRoot, SdkConstants.FD_TOOLS);
- pkg = scanTools(dir, monitor);
- if (pkg != null) {
- packages.add(pkg);
- visited.add(dir);
+ if ((parseFilter & PARSE_TOOLS) != 0) {
+ dir = new File(osSdkRoot, SdkConstants.FD_TOOLS);
+ pkg = scanTools(dir, monitor);
+ if (pkg != null) {
+ packages.add(pkg);
+ visited.add(dir);
+ }
}
monitor.incProgress(1);
- dir = new File(osSdkRoot, SdkConstants.FD_PLATFORM_TOOLS);
- pkg = scanPlatformTools(dir, monitor);
- if (pkg != null) {
- packages.add(pkg);
- visited.add(dir);
+ if ((parseFilter & PARSE_PLATFORM_TOOLS) != 0) {
+ dir = new File(osSdkRoot, SdkConstants.FD_PLATFORM_TOOLS);
+ pkg = scanPlatformTools(dir, monitor);
+ if (pkg != null) {
+ packages.add(pkg);
+ visited.add(dir);
+ }
}
monitor.incProgress(1);
- File samplesRoot = new File(osSdkRoot, SdkConstants.FD_SAMPLES);
-
// for platforms, add-ons and samples, rely on the SdkManager parser
- for(IAndroidTarget target : sdkManager.getTargets()) {
- Properties props = parseProperties(new File(target.getLocation(),
- SdkConstants.FN_SOURCE_PROP));
+ if ((parseFilter & (PARSE_ADDONS | PARSE_PLATFORMS)) != 0) {
+ File samplesRoot = new File(osSdkRoot, SdkConstants.FD_SAMPLES);
- try {
- if (target.isPlatform()) {
- pkg = PlatformPackage.create(target, props);
-
- if (samplesRoot.isDirectory()) {
- // Get the samples dir for a platform if it is located in the new
- // root /samples dir. We purposely ignore "old" samples that are
- // located under the platform dir.
- File samplesDir = new File(target.getPath(IAndroidTarget.SAMPLES));
- if (samplesDir.exists() && samplesDir.getParentFile().equals(samplesRoot)) {
- Properties samplesProps = parseProperties(
- new File(samplesDir, SdkConstants.FN_SOURCE_PROP));
- if (samplesProps != null) {
- Package pkg2 = SamplePackage.create(target, samplesProps);
- packages.add(pkg2);
+ for(IAndroidTarget target : sdkManager.getTargets()) {
+ Properties props = parseProperties(new File(target.getLocation(),
+ SdkConstants.FN_SOURCE_PROP));
+
+ try {
+ pkg = null;
+ if (target.isPlatform() && (parseFilter & PARSE_PLATFORMS) != 0) {
+ pkg = PlatformPackage.create(target, props);
+
+ if (samplesRoot.isDirectory()) {
+ // Get the samples dir for a platform if it is located in the new
+ // root /samples dir. We purposely ignore "old" samples that are
+ // located under the platform dir.
+ File samplesDir = new File(target.getPath(IAndroidTarget.SAMPLES));
+ if (samplesDir.exists() &&
+ samplesDir.getParentFile().equals(samplesRoot)) {
+ Properties samplesProps = parseProperties(
+ new File(samplesDir, SdkConstants.FN_SOURCE_PROP));
+ if (samplesProps != null) {
+ Package pkg2 = SamplePackage.create(target, samplesProps);
+ packages.add(pkg2);
+ }
+ visited.add(samplesDir);
}
- visited.add(samplesDir);
}
+ } else if ((parseFilter & PARSE_ADDONS) != 0) {
+ pkg = AddonPackage.create(target, props);
}
- } else {
- pkg = AddonPackage.create(target, props);
- }
- for (ISystemImage systemImage : target.getSystemImages()) {
- if (systemImage.getLocationType() == LocationType.IN_SYSTEM_IMAGE) {
- File siDir = systemImage.getLocation();
- if (siDir.isDirectory()) {
- Properties siProps = parseProperties(
- new File(siDir, SdkConstants.FN_SOURCE_PROP));
- Package pkg2 = new SystemImagePackage(
- target.getVersion(),
- 0 /*revision*/, // this will use the one from siProps if any
- systemImage.getAbiType(),
- siProps,
- siDir.getAbsolutePath());
- packages.add(pkg2);
- visited.add(siDir);
+ if (pkg != null) {
+ for (ISystemImage systemImage : target.getSystemImages()) {
+ if (systemImage.getLocationType() == LocationType.IN_SYSTEM_IMAGE) {
+ File siDir = systemImage.getLocation();
+ if (siDir.isDirectory()) {
+ Properties siProps = parseProperties(
+ new File(siDir, SdkConstants.FN_SOURCE_PROP));
+ Package pkg2 = new SystemImagePackage(
+ target.getVersion(),
+ 0 /*rev*/, // this will use the one from siProps
+ systemImage.getAbiType(),
+ siProps,
+ siDir.getAbsolutePath());
+ packages.add(pkg2);
+ visited.add(siDir);
+ }
+ }
}
}
- }
- } catch (Exception e) {
- monitor.error(e, null);
- }
+ } catch (Exception e) {
+ monitor.error(e, null);
+ }
- if (pkg != null) {
- packages.add(pkg);
- visited.add(new File(target.getLocation()));
+ if (pkg != null) {
+ packages.add(pkg);
+ visited.add(new File(target.getLocation()));
+ }
}
}
monitor.incProgress(1);
- scanMissingSystemImages(sdkManager, visited, packages, monitor);
+ if ((parseFilter & PARSE_PLATFORMS) != 0) {
+ scanMissingSystemImages(sdkManager, visited, packages, monitor);
+ }
monitor.incProgress(1);
- scanMissingAddons(sdkManager, visited, packages, monitor);
+ if ((parseFilter & PARSE_ADDONS) != 0) {
+ scanMissingAddons(sdkManager, visited, packages, monitor);
+ }
monitor.incProgress(1);
- scanMissingSamples(sdkManager, visited, packages, monitor);
+ if ((parseFilter & PARSE_SAMPLES) != 0) {
+ scanMissingSamples(sdkManager, visited, packages, monitor);
+ }
monitor.incProgress(1);
- scanExtras(sdkManager, visited, packages, monitor);
+ if ((parseFilter & PARSE_EXTRAS) != 0) {
+ scanExtras(sdkManager, visited, packages, monitor);
+ }
monitor.incProgress(1);
- scanExtrasDirectory(osSdkRoot, visited, packages, monitor);
+ if ((parseFilter & PARSE_EXTRAS) != 0) {
+ scanExtrasDirectory(osSdkRoot, visited, packages, monitor);
+ }
monitor.incProgress(1);
- scanSources(sdkManager, visited, packages, monitor);
+ if ((parseFilter & PARSE_SOURCES) != 0) {
+ scanSources(sdkManager, visited, packages, monitor);
+ }
monitor.incProgress(1);
Collections.sort(packages);
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java index 268a24c..a246584 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SystemImagePackage.java @@ -205,6 +205,7 @@ public class SystemImagePackage extends Package private static String getAbiDisplayNameInternal(String abi) {
return abi.replace("armeabi", "ARM EABI") //$NON-NLS-1$ //$NON-NLS-2$
.replace("x86", "Intel x86 Atom") //$NON-NLS-1$ //$NON-NLS-2$
+ .replace("mips", "Mips") //$NON-NLS-1$ //$NON-NLS-2$
.replace("-", " "); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd index 002a75b..87e183a 100755 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd @@ -67,7 +67,7 @@ - <extra> packages are removed. They are served only by the addon XML. - <platform>, <system-image>, <source>, <tool>, <platform-tool>, <doc> and <sample> get a new optional field <beta-rc> which can be used to indicate - the package is a Beta Release Candidate and not a final release. + the package is a Beta Release Candidate and not a final release. --> <xsd:element name="sdk-repository" type="sdk:repositoryType" /> @@ -225,6 +225,7 @@ <xsd:enumeration value="armeabi" /> <xsd:enumeration value="armeabi-v7a" /> <xsd:enumeration value="x86" /> + <xsd:enumeration value="mips" /> </xsd:restriction> </xsd:simpleType> diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java index 017d17c..f66adb8 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java @@ -40,6 +40,35 @@ public class LocalSdkParserTest extends SdkManagerTestCase { "Sources for Android SDK, API 0, revision 0]", Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor))); + assertEquals( + "[SDK Platform Android 0.0, API 0, revision 1, " + + "Sources for Android SDK, API 0, revision 0]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_PLATFORMS | LocalSdkParser.PARSE_SOURCES, + monitor))); + + assertEquals( + "[SDK Platform Android 0.0, API 0, revision 1]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_PLATFORMS, + monitor))); + + assertEquals( + "[Sources for Android SDK, API 0, revision 0]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_SOURCES, + monitor))); + + assertEquals( + "[]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_TOOLS, + monitor))); + // Now add a few "platform subfolders" system images and reload the SDK. // This disables the "legacy" mode but it still doesn't create any system image package @@ -89,6 +118,36 @@ public class LocalSdkParserTest extends SdkManagerTestCase { "Sources for Android SDK, API 0, revision 0, " + "Broken Intel x86 Atom System Image, API 0]", Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor))); + + assertEquals( + "[SDK Platform Android 0.0, API 0, revision 1, " + + "ARM EABI v7a System Image, Android API 0, revision 0, " + + "ARM EABI System Image, Android API 0, revision 0, " + + "Sources for Android SDK, API 0, revision 0, " + + "Broken Intel x86 Atom System Image, API 0]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_ALL, + monitor))); + + assertEquals( + "[SDK Platform Android 0.0, API 0, revision 1, " + + "ARM EABI v7a System Image, Android API 0, revision 0, " + + "ARM EABI System Image, Android API 0, revision 0, " + + "Sources for Android SDK, API 0, revision 0, " + + "Broken Intel x86 Atom System Image, API 0]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_PLATFORMS | // platform also loads system-images + LocalSdkParser.PARSE_SOURCES, + monitor))); + + assertEquals( + "[Sources for Android SDK, API 0, revision 0]", + Arrays.toString(parser.parseSdk(sdkman.getLocation(), + sdkman, + LocalSdkParser.PARSE_SOURCES, + monitor))); } } diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java index 77e9312..0659fc4 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkRepoSourceTest.java @@ -734,6 +734,7 @@ public class SdkRepoSourceTest extends TestCase { "Found Android SDK Platform-tools, revision 3\n" +
"Found Samples for SDK API 14, revision 24 (Obsolete)\n" +
"Found ARM EABI System Image, Android API 42, revision 12\n" +
+ "Found Mips System Image, Android API 42, revision 12\n" +
"Found Sources for Android SDK, API 42, revision 12\n",
monitor.getCapturedVerboseLog());
assertEquals("", monitor.getCapturedLog());
@@ -746,7 +747,7 @@ public class SdkRepoSourceTest extends TestCase { // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
Package[] pkgs = mSource.getPackages();
- assertEquals(15, pkgs.length);
+ assertEquals(16, pkgs.length);
for (Package p : pkgs) {
assertTrue(p.getArchives().length >= 1);
}
@@ -815,8 +816,9 @@ public class SdkRepoSourceTest extends TestCase { }
assertEquals(
"[42 armeabi, " +
- "2 armeabi-v7a, " +
- "2 x86]",
+ "42 mips, " +
+ "2 armeabi-v7a, " +
+ "2 x86]",
Arrays.toString(sysImgVersionAbi.toArray()));
// Check the source packages
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml index f29ebdf..e57b831 100755 --- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml +++ b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml @@ -297,6 +297,19 @@ </sdk:archives> </sdk:system-image> + <sdk:system-image> + <sdk:api-level>42</sdk:api-level> + <sdk:revision>12</sdk:revision> + <sdk:abi>mips</sdk:abi> + <sdk:archives> + <sdk:archive os="any"> + <sdk:size>12345</sdk:size> + <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum> + <sdk:url>http://www.example.com/plat42/mips/image12.zip</sdk:url> + </sdk:archive> + </sdk:archives> + </sdk:system-image> + <sdk:source> <sdk:api-level>42</sdk:api-level> <sdk:revision>12</sdk:revision> |