summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2009-08-05 19:25:35 -0700
committerXavier Ducrohet <xav@android.com>2009-08-05 19:31:04 -0700
commit2f6bd734c081c5ae96c724877ee86bfacc77a025 (patch)
treed10c1ebc624ea9e6ccbcdbc1f14265f8161ce5a4 /tools
parent8639e8e60b6b2d70970be3cadf1b66d66c4e1771 (diff)
downloadandroid_development-2f6bd734c081c5ae96c724877ee86bfacc77a025.tar.gz
android_development-2f6bd734c081c5ae96c724877ee86bfacc77a025.tar.bz2
android_development-2f6bd734c081c5ae96c724877ee86bfacc77a025.zip
Fix comparison of 2 doc packages that have the same codename/revision.
This made the Donut_r1 doc show up as upgrade to the donut_r1 doc. BUG: 2037448
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java27
1 files changed, 15 insertions, 12 deletions
diff --git a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java
index abd42fb9c..3bd731b0a 100755
--- a/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java
+++ b/tools/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DocPackage.java
@@ -166,22 +166,25 @@ public class DocPackage extends Package {
AndroidVersion replacementVersion = replacementDoc.getVersion();
- // the new doc is an update if the api level is higher
+ // the new doc is an update if the api level is higher (no matter the codename on either)
if (replacementVersion.getApiLevel() > mVersion.getApiLevel()) {
return UpdateInfo.UPDATE;
}
- // if it's the exactly same (including codename), we check the revision
- if (replacementVersion.equals(mVersion) &&
- replacementPackage.getRevision() > this.getRevision()) {
- return UpdateInfo.UPDATE;
- }
-
- // else we check if they have the same api level and the new one is a preview, in which
- // case it's also an update (since preview have the api level of the _previous_ version.
- if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&
- replacementVersion.isPreview()) {
- return UpdateInfo.UPDATE;
+ // Check if they're the same exact (api and codename)
+ if (replacementVersion.equals(mVersion)) {
+ // exact same version, so check the revision level
+ if (replacementPackage.getRevision() > this.getRevision()) {
+ return UpdateInfo.UPDATE;
+ }
+ } else {
+ // not the same version? we check if they have the same api level and the new one
+ // is a preview, in which case it's also an update (since preview have the api level
+ // of the _previous_ version.)
+ if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&
+ replacementVersion.isPreview()) {
+ return UpdateInfo.UPDATE;
+ }
}
// not an upgrade but not incompatible either.