OSDN Git Service

SDK Updater: addon id is name+vendor, lower case
authorRaphael <raphael@google.com>
Mon, 15 Jun 2009 23:35:00 +0000 (16:35 -0700)
committerRaphael <raphael@google.com>
Mon, 15 Jun 2009 23:35:41 +0000 (16:35 -0700)
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonPackage.java
sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java

index 08180b7..6d39098 100755 (executable)
@@ -206,7 +206,8 @@ public class AddonPackage extends Package {
     /**\r
      * Computes whether the given addon package is a suitable update for the current package.\r
      * The base method checks the class type.\r
-     * The addon package also tests that the name is the same and the revision number is greater.\r
+     * The addon package also tests that the name+vendor is the same and\r
+     * the revision number is greater.\r
      * <p/>\r
      * An update is just that: a new package that supersedes the current one. If the new\r
      * package has the same revision as the current one, it's not an update.\r
@@ -221,7 +222,11 @@ public class AddonPackage extends Package {
         }\r
 \r
         AddonPackage newPkg = (AddonPackage) replacementPackage;\r
-        return newPkg.getName().equalsIgnoreCase(this.getName()) &&\r
-        newPkg.getRevision() > this.getRevision();\r
+\r
+        String thisId = getName() + "+" + getVendor();                //$NON-NLS-1$\r
+        String newId  = newPkg.getName() + "+" + newPkg.getVendor();  //$NON-NLS-1$\r
+\r
+        return thisId.equalsIgnoreCase(newId) &&\r
+               newPkg.getRevision() > this.getRevision();\r
     }\r
 }\r
index d52cce6..4ff8fb8 100755 (executable)
@@ -270,7 +270,6 @@ public class LocalSdkParser {
                             SdkRepository.NS_SDK_REPOSITORY.equals(child.getNamespaceURI()) &&\r
                             elementFilter.equals(child.getLocalName())) {\r
                         String name = child.getLocalName();\r
-                        Package p = null;\r
 \r
                         try {\r
                             if (SdkRepository.NODE_ADD_ON.equals(name)) {\r