Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ade2e4e authored by cketti's avatar cketti
Browse files

Enable debug logging for newly installed debug builds

parent ea0d2ef5
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -16,10 +16,8 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Debug;
import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
@@ -160,11 +158,6 @@ public class K9 extends Application {
     */
    private static SharedPreferences sDatabaseVersionCache;

    /**
     * {@code true} if this is a debuggable build.
     */
    private static boolean sIsDebuggable;

    private static boolean mAnimations = true;

    private static boolean mConfirmDelete = false;
@@ -520,7 +513,6 @@ public class K9 extends Application {
        super.onCreate();
        app = this;

        sIsDebuggable = ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
        K9MailLib.setDebugStatus(new K9MailLib.DebugStatus() {
            @Override public boolean enabled() {
                return DEBUG;
@@ -664,12 +656,7 @@ public class K9 extends Application {
     */
    public static void loadPrefs(Preferences prefs) {
        SharedPreferences sprefs = prefs.getPreferences();
        DEBUG = sprefs.getBoolean("enableDebugLogging", false);
        if (!DEBUG && sIsDebuggable && Debug.isDebuggerConnected()) {
            // If the debugger is attached, we're probably (surprise surprise) debugging something.
            DEBUG = true;
            Log.i(K9.LOG_TAG, "Debugger attached; enabling debug logging.");
        }
        DEBUG = sprefs.getBoolean("enableDebugLogging", BuildConfig.DEVELOPER_MODE);
        DEBUG_SENSITIVE = sprefs.getBoolean("enableSensitiveLogging", false);
        mAnimations = sprefs.getBoolean("animations", true);
        mGesturesEnabled = sprefs.getBoolean("gesturesEnabled", false);