Adds preference to ignore touchscreen feature
A ridiclous number of apps claim to be incompatible with devices that don't have a touchscreen. This even includes devices that have the 'fake touchscreen' feature instead. Nearly all of those have no such requirement, so this preference allows you to ignore it and treat those apps as being compatible.
This commit is contained in:
parent
5c799559a9
commit
717df0b82f
@ -140,7 +140,9 @@
|
||||
<string name="showincompat_long">Show apps written for newer Android versions or different hardware</string>
|
||||
<string name="rooted">Root</string>
|
||||
<string name="rooted_long">Show apps that require root privileges</string>
|
||||
|
||||
<string name="ignoreTouch">Ignore Touchscreen</string>
|
||||
<string name="ignoreTouch_long">Always include apps that require touchscreen</string>
|
||||
|
||||
<string name="category_all">All</string>
|
||||
<string name="category_whatsnew">What\'s New</string>
|
||||
<string name="category_recentlyupdated">Recently Updated</string>
|
||||
|
@ -40,7 +40,10 @@
|
||||
<CheckBoxPreference android:title="@string/rooted"
|
||||
android:defaultValue="true" android:summary="@string/rooted_long"
|
||||
android:key="rooted" />
|
||||
</PreferenceCategory>
|
||||
<CheckBoxPreference android:title="@string/ignoreTouch"
|
||||
android:defaultValue="false" android:summary="@string/ignoreTouch_long"
|
||||
android:key="ignoreTouchscreen" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/maintenance">
|
||||
<Preference android:title="@string/reset" android:summary="@string/clear_all_cached_data"
|
||||
android:key="reset" />
|
||||
|
@ -307,8 +307,15 @@ public class DB {
|
||||
private static class EclairChecker extends CompatibilityChecker {
|
||||
|
||||
private HashSet<String> features;
|
||||
private boolean ignoreTouchscreen;
|
||||
|
||||
public EclairChecker(Context ctx) {
|
||||
|
||||
SharedPreferences prefs = PreferenceManager
|
||||
.getDefaultSharedPreferences(ctx);
|
||||
ignoreTouchscreen = prefs
|
||||
.getBoolean("ignoreTouchscreen", false);
|
||||
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
StringBuilder logMsg = new StringBuilder();
|
||||
logMsg.append("Available device features:");
|
||||
@ -326,7 +333,10 @@ public class DB {
|
||||
return false;
|
||||
if (apk.features != null) {
|
||||
for (String feat : apk.features) {
|
||||
if (!features.contains(feat)) {
|
||||
if (ignoreTouchscreen
|
||||
&& feat.equals("android.hardware.touchscreen")) {
|
||||
// Don't check it!
|
||||
} else if (!features.contains(feat)) {
|
||||
Log.d("FDroid", apk.id
|
||||
+ " is incompatible based on lack of "
|
||||
+ feat);
|
||||
|
Loading…
x
Reference in New Issue
Block a user