mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 05:55:04 -04:00
[app] Don't suggest incompatible versions in app details
This commit is contained in:
@@ -539,6 +539,7 @@ public class App implements Comparable<App>, Parcelable {
|
||||
}
|
||||
}
|
||||
// use the first of the list, before we don't choose anything
|
||||
// TODO does this still make sense? Maybe better to not suggest anything in this case?
|
||||
if (apk == null && apks.size() > 0) {
|
||||
apk = apks.get(0);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ public class AppDetailsRecyclerViewAdapter
|
||||
|
||||
items.clear();
|
||||
versions.clear();
|
||||
suggestedApk = null;
|
||||
|
||||
// Get versions
|
||||
compatibleVersionsDifferentSigner.clear();
|
||||
@@ -170,7 +171,14 @@ public class AppDetailsRecyclerViewAdapter
|
||||
}
|
||||
}
|
||||
}
|
||||
if (apks != null) suggestedApk = app.findSuggestedApk(apks, appPrefs);
|
||||
if (apks != null) {
|
||||
final Apk foundApk = app.findSuggestedApk(apks, appPrefs);
|
||||
// only use suggested APK, if app not installed, or signer matches installed signer
|
||||
// because otherwise, there's no use in suggesting it as we can't install it anyway
|
||||
if (app.installedSigner == null || (foundApk != null && app.installedSigner.equals(foundApk.signer))) {
|
||||
suggestedApk = foundApk;
|
||||
}
|
||||
}
|
||||
|
||||
addItem(VIEWTYPE_HEADER);
|
||||
if (!app.getAllScreenshots().isEmpty()) addItem(VIEWTYPE_SCREENSHOTS);
|
||||
|
||||
Reference in New Issue
Block a user