Log available device features

This commit is contained in:
Henrik Tunedal 2011-03-26 17:29:29 +01:00
parent 767f1a6866
commit 37732255b2
2 changed files with 12 additions and 1 deletions

View File

@ -188,6 +188,7 @@ public class AppDetails extends ListActivity {
protected void onStart() {
super.onStart();
db = new DB(this);
compatChecker = db.getCompatibilityChecker();
mPm = getPackageManager();
((FDroidApp) getApplication()).inActivity++;
// Get the preferences we're going to use in this Activity...
@ -195,7 +196,6 @@ public class AppDetails extends ListActivity {
.getDefaultSharedPreferences(getBaseContext());
pref_cacheDownloaded = prefs.getBoolean("cacheDownloaded", false);
pref_expert = prefs.getBoolean("expert", false);
compatChecker = DB.Apk.CompatibilityChecker.getChecker(this);
AppDetails old = (AppDetails)getLastNonConfigurationInstance();
if (old != null) {
copyState(old);

View File

@ -233,10 +233,15 @@ public class DB {
public EclairChecker(Context ctx) {
PackageManager pm = ctx.getPackageManager();
StringBuilder logMsg = new StringBuilder();
logMsg.append("Available device features:");
features = new HashSet<String>();
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
features.add(fi.name);
logMsg.append('\n');
logMsg.append(fi.name);
}
Log.d("FDroid", logMsg.toString());
}
public boolean isCompatible(Apk apk) {
@ -252,6 +257,12 @@ public class DB {
}
}
// Let other classes reuse the already instantiated compatibility
// checker, mostly to avoid redundant log output.
public Apk.CompatibilityChecker getCompatibilityChecker() {
return compatChecker;
}
// The TABLE_REPO table stores the details of the repositories in use.
private static final String TABLE_REPO = "fdroid_repo";
private static final String CREATE_TABLE_REPO = "create table "