diff --git a/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java b/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java index f73948ab7..749883646 100644 --- a/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java +++ b/F-Droid/src/org/fdroid/fdroid/CompatibilityChecker.java @@ -37,17 +37,22 @@ public class CompatibilityChecker extends Compatibility { ignoreTouchscreen = prefs.getBoolean(Preferences.PREF_IGN_TOUCH, false); PackageManager pm = ctx.getPackageManager(); - StringBuilder logMsg = new StringBuilder(); - logMsg.append("Available device features:"); + features = new HashSet<>(); if (pm != null) { final FeatureInfo[] featureArray = pm.getSystemAvailableFeatures(); - if (featureArray != null) + if (featureArray != null) { + if (BuildConfig.DEBUG) { + StringBuilder logMsg = new StringBuilder("Available device features:"); + for (FeatureInfo fi : pm.getSystemAvailableFeatures()) { + logMsg.append('\n').append(fi.name); + } + Log.d(TAG, logMsg.toString()); + } for (FeatureInfo fi : pm.getSystemAvailableFeatures()) { features.add(fi.name); - logMsg.append('\n'); - logMsg.append(fi.name); } + } } cpuAbis = SupportedArchitectures.getAbis(); @@ -62,8 +67,6 @@ public class CompatibilityChecker extends Compatibility { builder.append(abi); } cpuAbisDesc = builder.toString(); - - Log.d(TAG, logMsg.toString()); } private boolean compatibleApi(Utils.CommaSeparatedList nativecode) { @@ -96,9 +99,10 @@ public class CompatibilityChecker extends Compatibility { // Don't check it! } else if (!features.contains(feat)) { Collections.addAll(incompatibleReasons, feat.split(",")); - Log.d(TAG, apk.id + " vercode " + apk.vercode - + " is incompatible based on lack of " - + feat); + if (BuildConfig.DEBUG) { + Log.d(TAG, apk.id + " vercode " + apk.vercode + + " is incompatible based on lack of " + feat); + } } } } @@ -106,9 +110,11 @@ public class CompatibilityChecker extends Compatibility { for (final String code : apk.nativecode) { incompatibleReasons.add(code); } - Log.d(TAG, apk.id + " vercode " + apk.vercode - + " only supports " + Utils.CommaSeparatedList.str(apk.nativecode) - + " while your architectures are " + cpuAbisDesc); + if (BuildConfig.DEBUG) { + Log.d(TAG, apk.id + " vercode " + apk.vercode + + " only supports " + Utils.CommaSeparatedList.str(apk.nativecode) + + " while your architectures are " + cpuAbisDesc); + } } return incompatibleReasons; diff --git a/F-Droid/src/org/fdroid/fdroid/compat/PRNGFixes.java b/F-Droid/src/org/fdroid/fdroid/compat/PRNGFixes.java index 03a05fe08..a7b989efc 100644 --- a/F-Droid/src/org/fdroid/fdroid/compat/PRNGFixes.java +++ b/F-Droid/src/org/fdroid/fdroid/compat/PRNGFixes.java @@ -167,6 +167,8 @@ public final class PRNGFixes extends Compatibility { @SuppressWarnings("serial") public static class LinuxPRNGSecureRandom extends SecureRandomSpi { + private static final String TAG = "fdroid.PRNGFixes.LinuxPRNGSecureRandom"; + /* * IMPLEMENTATION NOTE: Requests to generate bytes and to mix in a seed * are passed through to the Linux PRNG (/dev/urandom). Instances of @@ -218,8 +220,7 @@ public final class PRNGFixes extends Compatibility { } catch (IOException e) { // On a small fraction of devices /dev/urandom is not writable. // Log and ignore. - Log.w(PRNGFixes.class.getSimpleName(), - "Failed to mix seed into " + URANDOM_FILE); + Log.w(TAG, "Failed to mix seed into " + URANDOM_FILE); } finally { mSeeded = true; } diff --git a/F-Droid/src/org/fdroid/fdroid/data/App.java b/F-Droid/src/org/fdroid/fdroid/data/App.java index 9c7cdd537..953b816cf 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/App.java +++ b/F-Droid/src/org/fdroid/fdroid/data/App.java @@ -30,6 +30,8 @@ import java.util.jar.JarFile; public class App extends ValueObject implements Comparable { + private static final String TAG = "fdroid.App"; + // True if compatible with the device (i.e. if at least one apk is) public boolean compatible; public boolean includeInRepo = false; @@ -228,7 +230,7 @@ public class App extends ValueObject implements Comparable { PackageManager.GET_META_DATA); installerPackageLabel = installerAppInfo.loadLabel(pm); } catch (PackageManager.NameNotFoundException e) { - Log.d(getClass().getCanonicalName(), e.getMessage()); + Log.d(TAG, e.getMessage()); } } if (TextUtils.isEmpty(installerPackageLabel)) diff --git a/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java b/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java index aae150721..c139fb034 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java +++ b/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java @@ -23,7 +23,7 @@ public class RepoProvider extends FDroidProvider { public static final class Helper { - public static final String TAG = "fdroid.RepoProvider.Helper"; + private static final String TAG = "fdroid.RepoProvider.Helper"; private Helper() {} diff --git a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java index 87083ec1d..d3ef6abf2 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java @@ -40,7 +40,7 @@ abstract public class Installer { protected final PackageManager mPm; protected final InstallerCallback mCallback; - public static final String TAG = "fdroid.Installer"; + private static final String TAG = "fdroid.Installer"; /** * This is thrown when an Installer is not compatible with the Android OS it diff --git a/F-Droid/src/org/fdroid/fdroid/installer/RootInstaller.java b/F-Droid/src/org/fdroid/fdroid/installer/RootInstaller.java index 931366716..f54ceb2f5 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/RootInstaller.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/RootInstaller.java @@ -37,6 +37,8 @@ import eu.chainfire.libsuperuser.Shell; */ public class RootInstaller extends Installer { + private static final String TAG = "fdroid.RootInstaller"; + Shell.Interactive rootSession; public RootInstaller(Context context, PackageManager pm, InstallerCallback callback) diff --git a/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java b/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java index cd58fcd82..407b5ac2f 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java @@ -58,6 +58,8 @@ import java.util.List; */ public class SystemInstaller extends Installer { + private static final String TAG = "fdroid.SystemInstaller"; + private PackageInstallObserver mInstallObserver; private PackageDeleteObserver mDeleteObserver; private Method mInstallMethod; diff --git a/F-Droid/src/org/fdroid/fdroid/net/MDnsHelper.java b/F-Droid/src/org/fdroid/fdroid/net/MDnsHelper.java index cdd3e59b6..ad9924a81 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/MDnsHelper.java +++ b/F-Droid/src/org/fdroid/fdroid/net/MDnsHelper.java @@ -28,7 +28,7 @@ import javax.jmdns.ServiceListener; public class MDnsHelper implements ServiceListener { - public static final String TAG = "fdroid.MDnsHelper"; + private static final String TAG = "fdroid.MDnsHelper"; public static final String HTTP_SERVICE_TYPE = "_http._tcp.local."; public static final String HTTPS_SERVICE_TYPE = "_https._tcp.local."; diff --git a/F-Droid/src/org/fdroid/fdroid/views/RepoDetailsActivity.java b/F-Droid/src/org/fdroid/fdroid/views/RepoDetailsActivity.java index a57bd749e..9e732b07e 100644 --- a/F-Droid/src/org/fdroid/fdroid/views/RepoDetailsActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/views/RepoDetailsActivity.java @@ -23,7 +23,7 @@ import org.fdroid.fdroid.data.RepoProvider; import org.fdroid.fdroid.views.fragments.RepoDetailsFragment; public class RepoDetailsActivity extends ActionBarActivity { - public static final String TAG = "fdroid.RepoDetailsActivity"; + private static final String TAG = "fdroid.RepoDetailsActivity"; private Repo repo;