Merge change 4261 into donut

* changes:
  SDK Updater: addon id is name+vendor, lower case
This commit is contained in:
Android (Google) Code Review
2009-06-15 16:55:20 -07:00
2 changed files with 8 additions and 4 deletions

View File

@@ -206,7 +206,8 @@ public class AddonPackage extends Package {
/** /**
* Computes whether the given addon package is a suitable update for the current package. * Computes whether the given addon package is a suitable update for the current package.
* The base method checks the class type. * 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.
* <p/> * <p/>
* An update is just that: a new package that supersedes the current one. If the new * 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. * 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; 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();
} }
} }

View File

@@ -270,7 +270,6 @@ public class LocalSdkParser {
SdkRepository.NS_SDK_REPOSITORY.equals(child.getNamespaceURI()) && SdkRepository.NS_SDK_REPOSITORY.equals(child.getNamespaceURI()) &&
elementFilter.equals(child.getLocalName())) { elementFilter.equals(child.getLocalName())) {
String name = child.getLocalName(); String name = child.getLocalName();
Package p = null;
try { try {
if (SdkRepository.NODE_ADD_ON.equals(name)) { if (SdkRepository.NODE_ADD_ON.equals(name)) {