From 637c630a84447c98a44bcf5065d0c32ef380405e Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 15 Jun 2009 16:35:00 -0700 Subject: [PATCH] SDK Updater: addon id is name+vendor, lower case --- .../com/android/sdklib/internal/repository/AddonPackage.java | 11 ++++++++--- .../android/sdklib/internal/repository/LocalSdkParser.java | 1 - 2 files changed, 8 insertions(+), 4 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 08180b701..6d3909832 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 @@ -206,7 +206,8 @@ public class AddonPackage extends Package { /** * Computes whether the given addon package is a suitable update for the current package. * The base method checks the class type. - * The addon package also tests that the name is the same and the revision number is greater. + * The addon package also tests that the name+vendor is the same and + * the revision number is greater. *

* An update is just that: a new package that supersedes the current one. If the new * package has the same revision as the current one, it's not an update. @@ -221,7 +222,11 @@ public class AddonPackage extends Package { } AddonPackage newPkg = (AddonPackage) replacementPackage; - return newPkg.getName().equalsIgnoreCase(this.getName()) && - newPkg.getRevision() > this.getRevision(); + + String thisId = getName() + "+" + getVendor(); //$NON-NLS-1$ + String newId = newPkg.getName() + "+" + newPkg.getVendor(); //$NON-NLS-1$ + + return thisId.equalsIgnoreCase(newId) && + newPkg.getRevision() > this.getRevision(); } } 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 d52cce658..4ff8fb869 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 @@ -270,7 +270,6 @@ public class LocalSdkParser { SdkRepository.NS_SDK_REPOSITORY.equals(child.getNamespaceURI()) && elementFilter.equals(child.getLocalName())) { String name = child.getLocalName(); - Package p = null; try { if (SdkRepository.NODE_ADD_ON.equals(name)) { -- 2.11.0