Don't show versions with a different sig if installed.

This should probably be done on the database level, if purely for the
fact that we have a good set of unit tests for that. However it is still
quite clean to do so here.
This commit is contained in:
Peter Serwylo 2017-06-12 21:31:47 +10:00
parent 189b2277ba
commit 28b7d69e60

View File

@ -114,7 +114,9 @@ public class AppDetailsRecyclerViewAdapter
versions = new ArrayList<>(); versions = new ArrayList<>();
final List<Apk> apks = ApkProvider.Helper.findByPackageName(context, this.app.packageName); final List<Apk> apks = ApkProvider.Helper.findByPackageName(context, this.app.packageName);
for (final Apk apk : apks) { for (final Apk apk : apks) {
if (apk.compatible || Preferences.get().showIncompatibleVersions()) { boolean allowByCompatability = apk.compatible || Preferences.get().showIncompatibleVersions();
boolean allowBySig = this.app.installedSig == null || TextUtils.equals(this.app.installedSig, apk.sig);
if (allowByCompatability && allowBySig) {
versions.add(apk); versions.add(apk);
} }
} }