OSDN Git Service

Read the default skin from sdk.properties.
authorXavier Ducrohet <xav@android.com>
Sun, 17 Jul 2011 21:19:56 +0000 (14:19 -0700)
committerXavier Ducrohet <xav@android.com>
Sun, 17 Jul 2011 21:23:17 +0000 (14:23 -0700)
Change-Id: Ifad6f2186e499f579df1608055dda4eca1084830

sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
sdkmanager/libs/sdklib/src/com/android/sdklib/SdkConstants.java

index c1ac84b..467529d 100644 (file)
@@ -226,13 +226,20 @@ final class PlatformTarget implements IAndroidTarget {
     }
 
     public String getDefaultSkin() {
+        // only one skin? easy.
         if (mSkins.length == 1) {
             return mSkins[0];
         }
 
+        // look for the skin name in the platform props
+        String skinName = mProperties.get(SdkConstants.PROP_SDK_DEFAULT_SKIN);
+        if (skinName != null) {
+            return skinName;
+        }
+
+        // otherwise try to find a good default.
         if (mVersion.getApiLevel() >= 4) {
-            // at this time, this is the default skin for all the platforms.
-            // TODO: make it configurable using a file in the platform folder.
+            // at this time, this is the default skin for all older platforms that had 2+ skins.
             return "WVGA800";
         }
 
index bac2464..8f5b69c 100644 (file)
@@ -357,6 +357,9 @@ public final class SdkConstants {
     /** SDK property: ant templates revision */
     public final static String PROP_SDK_ANT_TEMPLATES_REVISION = "sdk.ant.templates.revision"; //$NON-NLS-1$
 
+    /** SDK property: default skin */
+    public final static String PROP_SDK_DEFAULT_SKIN = "sdk.skin.default"; //$NON-NLS-1$
+
 
     /* Android Class Constants */
     public final static String CLASS_ACTIVITY = "android.app.Activity"; //$NON-NLS-1$