aboutsummaryrefslogtreecommitdiffstats
path: root/sdkmanager/libs/sdklib/src
diff options
context:
space:
mode:
Diffstat (limited to 'sdkmanager/libs/sdklib/src')
-rwxr-xr-xsdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java
index a784b34..56bf492 100755
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java
+++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java
@@ -577,6 +577,17 @@ public class AddonPackage extends Package
String name = displayName.toLowerCase(Locale.US);
name = name.replaceAll("[^a-z0-9_-]+", "_"); //$NON-NLS-1$ //$NON-NLS-2$
name = name.replaceAll("_+", "_"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // NOTE: ideally we would want to trim leading and trailing _ but in fact
+ // this MUST NOT be done, otherwise it will break <vendor-id> tags that were
+ // auto converted from the old <vendor> tag when switching from the addon
+ // schema v3 to v4.
+ // if (name.length() > 1) {
+ // name = name.replaceAll("^_+", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ // }
+ // if (name.length() > 1) {
+ // name = name.replaceAll("_+$", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ // }
return name;
}