From 7d0e13493c641f3aa746dcb4c341e29e12dfe9f9 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 9 Jan 2022 14:48:37 +0100 Subject: [PATCH] Enable crash reports by default in test versions --- app/src/main/java/eu/faircode/email/Helper.java | 2 +- app/src/main/java/eu/faircode/email/Log.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index ae314bab37..1a8be8f433 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -934,7 +934,7 @@ public class Helper { html += "Locale: " + Html.escapeHtml(slocale.toString()) + "
"; if (language != null) html += "Language: " + Html.escapeHtml(language) + "
"; - if (reporting && uuid != null) + if ((reporting || BuildConfig.TEST_RELEASE) && uuid != null) html += "UUID: " + Html.escapeHtml(uuid) + "
"; html += "

"; diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 470e33a2dc..abd9dcec2d 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -424,7 +424,7 @@ public class Log { @Override public boolean onSession(@NonNull Session session) { // opt-in - return prefs.getBoolean("crash_reports", false); + return prefs.getBoolean("crash_reports", false) || BuildConfig.TEST_RELEASE; } }); @@ -433,7 +433,7 @@ public class Log { public boolean onError(@NonNull Event event) { // opt-in boolean crash_reports = prefs.getBoolean("crash_reports", false); - if (!crash_reports) + if (!crash_reports && !BuildConfig.TEST_RELEASE) return false; Throwable ex = event.getOriginalError(); @@ -536,7 +536,7 @@ public class Log { Log.i("uuid=" + uuid); client.setUser(uuid, null, null); - if (prefs.getBoolean("crash_reports", false)) + if (prefs.getBoolean("crash_reports", false) || BuildConfig.TEST_RELEASE) Bugsnag.startSession(); } catch (Throwable ex) { Log.e(ex); @@ -1784,7 +1784,7 @@ public class Log { Build.VERSION.RELEASE, Build.VERSION.SDK_INT, targetSdk)); boolean reporting = prefs.getBoolean("crash_reports", false); - if (reporting) { + if (reporting || BuildConfig.TEST_RELEASE) { String uuid = prefs.getString("uuid", null); sb.append(String.format("UUID: %s\r\n", uuid == null ? "-" : uuid)); }