\r
AndroidVersion replacementVersion = replacementDoc.getVersion();\r
\r
- // the new doc is an update if the api level is higher\r
+ // the new doc is an update if the api level is higher (no matter the codename on either)\r
if (replacementVersion.getApiLevel() > mVersion.getApiLevel()) {\r
return UpdateInfo.UPDATE;\r
}\r
\r
- // if it's the exactly same (including codename), we check the revision\r
- if (replacementVersion.equals(mVersion) &&\r
- replacementPackage.getRevision() > this.getRevision()) {\r
- return UpdateInfo.UPDATE;\r
- }\r
-\r
- // else we check if they have the same api level and the new one is a preview, in which\r
- // case it's also an update (since preview have the api level of the _previous_ version.\r
- if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&\r
- replacementVersion.isPreview()) {\r
- return UpdateInfo.UPDATE;\r
+ // Check if they're the same exact (api and codename)\r
+ if (replacementVersion.equals(mVersion)) {\r
+ // exact same version, so check the revision level\r
+ if (replacementPackage.getRevision() > this.getRevision()) {\r
+ return UpdateInfo.UPDATE;\r
+ }\r
+ } else {\r
+ // not the same version? we check if they have the same api level and the new one\r
+ // is a preview, in which case it's also an update (since preview have the api level\r
+ // of the _previous_ version.)\r
+ if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&\r
+ replacementVersion.isPreview()) {\r
+ return UpdateInfo.UPDATE;\r
+ }\r
}\r
\r
// not an upgrade but not incompatible either.\r