Clarify comments in response to CR.
This commit is contained in:
parent
82eb50c2fe
commit
d0444dafca
@ -953,6 +953,8 @@ public class AppProvider extends FDroidProvider {
|
|||||||
* with the closest version code to that, without going over.
|
* with the closest version code to that, without going over.
|
||||||
* If the app is not compatible at all (i.e. no versions were compatible)
|
* If the app is not compatible at all (i.e. no versions were compatible)
|
||||||
* then we take the highest, otherwise we take the highest compatible version.
|
* then we take the highest, otherwise we take the highest compatible version.
|
||||||
|
* If the app is installed, then all apks signed by a different certificate are
|
||||||
|
* ignored for the purpose of this calculation.
|
||||||
*
|
*
|
||||||
* @see #updateSuggestedFromLatest()
|
* @see #updateSuggestedFromLatest()
|
||||||
*/
|
*/
|
||||||
@ -1030,12 +1032,14 @@ public class AppProvider extends FDroidProvider {
|
|||||||
" installed." + InstalledAppTable.Cols.PACKAGE_NAME + " = pkg." + PackageTable.Cols.PACKAGE_NAME + ") " +
|
" installed." + InstalledAppTable.Cols.PACKAGE_NAME + " = pkg." + PackageTable.Cols.PACKAGE_NAME + ") " +
|
||||||
")";
|
")";
|
||||||
|
|
||||||
// If the installed sig is not null, then the apk signature will need to match that.
|
// Ideally, the check below would actually be written as:
|
||||||
// If the installed sig IS null, then it will check whether the apk sig matches the apk sig
|
// `installedSig IS NULL OR installedSig = apk.sig`
|
||||||
// (i.e. it will always return the app).
|
|
||||||
// This would be better writen as: `installedSig IS NULL OR installedSig = apk.sig`,
|
|
||||||
// however that would require a separate sub query for each `installedSig` which is more
|
// however that would require a separate sub query for each `installedSig` which is more
|
||||||
// expensive. This is a less expressive way to write the same thing.
|
// expensive. Using a COALESCE is a less expressive way to write the same thing with only
|
||||||
|
// a single subquery.
|
||||||
|
// Also note that the `installedSig IS NULL` is not because there is a `NULL` entry in the
|
||||||
|
// installed table (this is impossible), but rather because the subselect above returned
|
||||||
|
// zero rows.
|
||||||
return apkTable + "." + ApkTable.Cols.SIGNATURE + " = " +
|
return apkTable + "." + ApkTable.Cols.SIGNATURE + " = " +
|
||||||
"COALESCE(" + installedSig + ", " + apkTable + "." + ApkTable.Cols.SIGNATURE + ")";
|
"COALESCE(" + installedSig + ", " + apkTable + "." + ApkTable.Cols.SIGNATURE + ")";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user