From 763b4d3ea061bf85ca474fe3f06ba6279c7d5afd Mon Sep 17 00:00:00 2001 From: Kevin Everets Date: Wed, 15 Jan 2014 15:18:09 -0500 Subject: [PATCH] Keep track of the reason that an apk is incompatible --- src/org/fdroid/fdroid/DB.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index 19525f405..9a0da7712 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -301,6 +301,8 @@ public class DB { public CommaSeparatedList nativecode; // null if empty or unknown + public CommaSeparatedList incompatible_reasons; // null if empty or + // unknown // ID (md5 sum of public key) of signature. Might be null, in the // transition to this field existing. public String sig; @@ -372,14 +374,17 @@ public class DB { } public boolean isCompatible(Apk apk) { - if (!hasApi(apk.minSdkVersion)) + if (!hasApi(apk.minSdkVersion)) { + apk.incompatible_reasons = CommaSeparatedList.make(String.valueOf(apk.minSdkVersion)); return false; + } if (apk.features != null) { for (String feat : apk.features) { if (ignoreTouchscreen && feat.equals("android.hardware.touchscreen")) { // Don't check it! } else if (!features.contains(feat)) { + apk.incompatible_reasons = CommaSeparatedList.make(feat); Log.d("FDroid", apk.id + " vercode " + apk.vercode + " is incompatible based on lack of " + feat); @@ -388,6 +393,7 @@ public class DB { } } if (!compatibleApi(apk.nativecode)) { + apk.incompatible_reasons = apk.nativecode; Log.d("FDroid", apk.id + " vercode " + apk.vercode + " only supports " + CommaSeparatedList.str(apk.nativecode) + " while your architectures are " + cpuAbisDesc);