Log available device features
This commit is contained in:
parent
767f1a6866
commit
37732255b2
@ -188,6 +188,7 @@ public class AppDetails extends ListActivity {
|
|||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
db = new DB(this);
|
db = new DB(this);
|
||||||
|
compatChecker = db.getCompatibilityChecker();
|
||||||
mPm = getPackageManager();
|
mPm = getPackageManager();
|
||||||
((FDroidApp) getApplication()).inActivity++;
|
((FDroidApp) getApplication()).inActivity++;
|
||||||
// Get the preferences we're going to use in this Activity...
|
// Get the preferences we're going to use in this Activity...
|
||||||
@ -195,7 +196,6 @@ public class AppDetails extends ListActivity {
|
|||||||
.getDefaultSharedPreferences(getBaseContext());
|
.getDefaultSharedPreferences(getBaseContext());
|
||||||
pref_cacheDownloaded = prefs.getBoolean("cacheDownloaded", false);
|
pref_cacheDownloaded = prefs.getBoolean("cacheDownloaded", false);
|
||||||
pref_expert = prefs.getBoolean("expert", false);
|
pref_expert = prefs.getBoolean("expert", false);
|
||||||
compatChecker = DB.Apk.CompatibilityChecker.getChecker(this);
|
|
||||||
AppDetails old = (AppDetails)getLastNonConfigurationInstance();
|
AppDetails old = (AppDetails)getLastNonConfigurationInstance();
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
copyState(old);
|
copyState(old);
|
||||||
|
@ -233,10 +233,15 @@ public class DB {
|
|||||||
|
|
||||||
public EclairChecker(Context ctx) {
|
public EclairChecker(Context ctx) {
|
||||||
PackageManager pm = ctx.getPackageManager();
|
PackageManager pm = ctx.getPackageManager();
|
||||||
|
StringBuilder logMsg = new StringBuilder();
|
||||||
|
logMsg.append("Available device features:");
|
||||||
features = new HashSet<String>();
|
features = new HashSet<String>();
|
||||||
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
|
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
|
||||||
features.add(fi.name);
|
features.add(fi.name);
|
||||||
|
logMsg.append('\n');
|
||||||
|
logMsg.append(fi.name);
|
||||||
}
|
}
|
||||||
|
Log.d("FDroid", logMsg.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCompatible(Apk apk) {
|
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.
|
// The TABLE_REPO table stores the details of the repositories in use.
|
||||||
private static final String TABLE_REPO = "fdroid_repo";
|
private static final String TABLE_REPO = "fdroid_repo";
|
||||||
private static final String CREATE_TABLE_REPO = "create table "
|
private static final String CREATE_TABLE_REPO = "create table "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user