Misc updates on the Sdklib.

- moved some code around
- made the constant in IAndroidTarget actual constant (they were not final)
This commit is contained in:
Xavier Ducrohet
2009-06-01 17:16:07 -07:00
parent 8a0c221a20
commit b10ffbaf3d
2 changed files with 30 additions and 31 deletions

View File

@@ -24,57 +24,57 @@ package com.android.sdklib;
public interface IAndroidTarget extends Comparable<IAndroidTarget> { public interface IAndroidTarget extends Comparable<IAndroidTarget> {
/** OS Path to the "android.jar" file. */ /** OS Path to the "android.jar" file. */
public static int ANDROID_JAR = 1; public final static int ANDROID_JAR = 1;
/** OS Path to the "framework.aidl" file. */ /** OS Path to the "framework.aidl" file. */
public static int ANDROID_AIDL = 2; public final static int ANDROID_AIDL = 2;
/** OS Path to "images" folder which contains the emulator system images. */ /** OS Path to "images" folder which contains the emulator system images. */
public static int IMAGES = 3; public final static int IMAGES = 3;
/** OS Path to the "samples" folder which contains sample projects. */ /** OS Path to the "samples" folder which contains sample projects. */
public static int SAMPLES = 4; public final static int SAMPLES = 4;
/** OS Path to the "skins" folder which contains the emulator skins. */ /** OS Path to the "skins" folder which contains the emulator skins. */
public static int SKINS = 5; public final static int SKINS = 5;
/** OS Path to the "templates" folder which contains the templates for new projects. */ /** OS Path to the "templates" folder which contains the templates for new projects. */
public static int TEMPLATES = 6; public final static int TEMPLATES = 6;
/** OS Path to the "data" folder which contains data & libraries for the SDK tools. */ /** OS Path to the "data" folder which contains data & libraries for the SDK tools. */
public static int DATA = 7; public final static int DATA = 7;
/** OS Path to the "attrs.xml" file. */ /** OS Path to the "attrs.xml" file. */
public static int ATTRIBUTES = 8; public final static int ATTRIBUTES = 8;
/** OS Path to the "attrs_manifest.xml" file. */ /** OS Path to the "attrs_manifest.xml" file. */
public static int MANIFEST_ATTRIBUTES = 9; public final static int MANIFEST_ATTRIBUTES = 9;
/** OS Path to the "data/layoutlib.jar" library. */ /** OS Path to the "data/layoutlib.jar" library. */
public static int LAYOUT_LIB = 10; public final static int LAYOUT_LIB = 10;
/** OS Path to the "data/res" folder. */ /** OS Path to the "data/res" folder. */
public static int RESOURCES = 11; public final static int RESOURCES = 11;
/** OS Path to the "data/fonts" folder. */ /** OS Path to the "data/fonts" folder. */
public static int FONTS = 12; public final static int FONTS = 12;
/** OS Path to the "data/widgets.txt" file. */ /** OS Path to the "data/widgets.txt" file. */
public static int WIDGETS = 13; public final static int WIDGETS = 13;
/** OS Path to the "data/activity_actions.txt" file. */ /** OS Path to the "data/activity_actions.txt" file. */
public static int ACTIONS_ACTIVITY = 14; public final static int ACTIONS_ACTIVITY = 14;
/** OS Path to the "data/broadcast_actions.txt" file. */ /** OS Path to the "data/broadcast_actions.txt" file. */
public static int ACTIONS_BROADCAST = 15; public final static int ACTIONS_BROADCAST = 15;
/** OS Path to the "data/service_actions.txt" file. */ /** OS Path to the "data/service_actions.txt" file. */
public static int ACTIONS_SERVICE = 16; public final static int ACTIONS_SERVICE = 16;
/** OS Path to the "data/categories.txt" file. */ /** OS Path to the "data/categories.txt" file. */
public static int CATEGORIES = 17; public final static int CATEGORIES = 17;
/** OS Path to the "sources" folder. */ /** OS Path to the "sources" folder. */
public static int SOURCES = 18; public final static int SOURCES = 18;
/** OS Path to the target specific docs */ /** OS Path to the target specific docs */
public static int DOCS = 19; public final static int DOCS = 19;
/** OS Path to the target's version of the aapt tool. */ /** OS Path to the target's version of the aapt tool. */
public static int AAPT = 20; public final static int AAPT = 20;
/** OS Path to the target's version of the aidl tool. */ /** OS Path to the target's version of the aidl tool. */
public static int AIDL = 21; public final static int AIDL = 21;
/** OS Path to the target's version of the dx too. */ /** OS Path to the target's version of the dx too. */
public static int DX = 22; public final static int DX = 22;
/** OS Path to the target's version of the dx.jar file. */ /** OS Path to the target's version of the dx.jar file. */
public static int DX_JAR = 23; public final static int DX_JAR = 23;
/** /**
* Return value for {@link #getUsbVendorId()} meaning no USB vendor IDs are defined by the * Return value for {@link #getUsbVendorId()} meaning no USB vendor IDs are defined by the
* Android target. * Android target.
*/ */
public static int NO_USB_ID = 0; public final static int NO_USB_ID = 0;
public interface IOptionalLibrary { public interface IOptionalLibrary {
String getName(); String getName();

View File

@@ -420,13 +420,6 @@ public final class SdkManager {
// get the default skin, or take it from the base platform if needed. // get the default skin, or take it from the base platform if needed.
String defaultSkin = propertyMap.get(ADDON_DEFAULT_SKIN); String defaultSkin = propertyMap.get(ADDON_DEFAULT_SKIN);
// get the USB ID (if available)
int usbVendorId = convertId(propertyMap.get(ADDON_USB_VENDOR));
if (usbVendorId != IAndroidTarget.NO_USB_ID) {
target.setUsbVendorId(usbVendorId);
}
if (defaultSkin == null) { if (defaultSkin == null) {
if (skins.length == 1) { if (skins.length == 1) {
defaultSkin = skins[1]; defaultSkin = skins[1];
@@ -435,6 +428,12 @@ public final class SdkManager {
} }
} }
// get the USB ID (if available)
int usbVendorId = convertId(propertyMap.get(ADDON_USB_VENDOR));
if (usbVendorId != IAndroidTarget.NO_USB_ID) {
target.setUsbVendorId(usbVendorId);
}
target.setSkins(skins, defaultSkin); target.setSkins(skins, defaultSkin);
return target; return target;