diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-08-13 21:56:52 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-08-13 21:56:52 +0200 |
commit | f382943d696f0c05d3a73436bfbd735263d22fda (patch) | |
tree | 89d40c09967a47a6c76f34d87ae0fc254f90b433 /src/main/java | |
parent | 44bf3cfb2d8e05d27ab1060a9f39333c97b15221 (diff) |
make human readable logs export optional and false as default
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/ExportLogsService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/services/ExportLogsService.java b/src/main/java/de/pixart/messenger/services/ExportLogsService.java index ff63a6dbb..8dcabcaf7 100644 --- a/src/main/java/de/pixart/messenger/services/ExportLogsService.java +++ b/src/main/java/de/pixart/messenger/services/ExportLogsService.java @@ -4,7 +4,9 @@ import android.app.NotificationManager; import android.app.Service; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.os.IBinder; +import android.preference.PreferenceManager; import android.support.v4.app.NotificationCompat; import android.util.Log; @@ -42,11 +44,14 @@ public class ExportLogsService extends Service { private static AtomicBoolean running = new AtomicBoolean(false); private DatabaseBackend mDatabaseBackend; private List<Account> mAccounts; + boolean ReadableLogsEnabled = false; @Override public void onCreate() { mDatabaseBackend = DatabaseBackend.getInstance(getBaseContext()); mAccounts = mDatabaseBackend.getAccounts(); + final SharedPreferences ReadableLogs = PreferenceManager.getDefaultSharedPreferences(this); + ReadableLogsEnabled = ReadableLogs.getBoolean("export_plain_text_logs", false); } @Override @@ -76,9 +81,10 @@ public class ExportLogsService extends Service { .setProgress(0, 0, true); startForeground(NOTIFICATION_ID, mBuilder.build()); mNotifyManager.notify(NOTIFICATION_ID, mBuilder.build()); - - for (Conversation conversation : conversations) { - writeToFile(conversation); + if (ReadableLogsEnabled) { + for (Conversation conversation : conversations) { + writeToFile(conversation); + } } if (mAccounts.size() == 1) { try { |