[app] Don't add a fake installed version to app's version list when it isn't from current repo

Doing this causes the "No compatible versions" message to not appear
This commit is contained in:
Torsten Grote
2024-06-06 09:58:01 -03:00
parent 774a51f614
commit 4a3d9ba2d2

View File

@@ -152,7 +152,6 @@ public class AppDetailsRecyclerViewAdapter
// Get versions
compatibleVersionsDifferentSigner.clear();
if (apks != null) addInstalledApkIfExists(apks);
boolean showIncompatibleVersions = Preferences.get().showIncompatibleVersions();
if (apks != null) {
for (final Apk apk : apks) {
@@ -199,19 +198,6 @@ public class AppDetailsRecyclerViewAdapter
notifyItemChanged(0); // header changed
}
private void addInstalledApkIfExists(final List<Apk> apks) {
if (app == null) return;
Apk installedApk = app.getInstalledApk(context, apks);
// These conditions should be enough to determine if the installedApk
// is a generated dummy or a proper APK containing data from a repository.
if (installedApk != null && installedApk.added == null && installedApk.signer == null) {
installedApk.compatible = true;
installedApk.signer = app.installedSigner;
installedApk.maxSdkVersion = -1;
apks.add(installedApk);
}
}
void setShowVersions(boolean showVersions) {
setShowVersions(showVersions, false);
}