From aab3b4484c785372dcd3917cf7463786c385613f Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 10 May 2019 10:10:13 +0200 Subject: [PATCH] Error reporting is opt-in --- FAQ.md | 15 +++++ PRIVACY.md | 2 + .../java/eu/faircode/email/ActivityView.java | 48 ++++++++++++++++ .../faircode/email/FragmentOptionsMisc.java | 2 +- app/src/main/res/layout/dialog_bugsnag.xml | 55 +++++++++++++++++++ app/src/main/res/values/strings.xml | 4 +- 6 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/layout/dialog_bugsnag.xml diff --git a/FAQ.md b/FAQ.md index 5c3cac4f1f..abca5330a5 100644 --- a/FAQ.md +++ b/FAQ.md @@ -173,6 +173,7 @@ FairEmail follows all the best practices for an email client as decribed in [thi * [(101) What does the blue/orange dot at the bottom of the conversations mean?](#user-content-faq101) * [(102) How can I enable auto rotation of images?](#user-content-faq102) * [(103) How can I record audio?](#user-content-faq103) +* [(104) What do I need to know about error reporting?](#user-content-faq104) [I have another question.](#support) @@ -1682,6 +1683,20 @@ Unfortunately and surprisingly, most recording apps do not seem to support this
+ +**(104) What do I need to know about error reporting?** + +* Error reports will help improve FairEmail +* Error reporting is optional and opt-in +* Error reporting can be enabled/disabled in the advanced options, section miscellaneous +* Error reports will be sent to [Bugsnag](https://www.bugsnag.com/) +* Bugsnag for Android is [open source](https://github.com/bugsnag/bugsnag-android) +* See [here](https://docs.bugsnag.com/platforms/android/automatically-captured-data/) about what data will be sent in case of errors +* See [here](https://docs.bugsnag.com/legal/privacy-policy/) for the privacy policy of Bugsnag + +
+ + ## Support If you have another question, want to request a feature or report a bug, you can use [this forum](https://forum.xda-developers.com/android/apps-games/source-email-t3824168). diff --git a/PRIVACY.md b/PRIVACY.md index 2300bdead8..45a39939d4 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -15,4 +15,6 @@ FairEmail **does not** allow other apps access to messages and attachments witho FairEmail is 100 % **open source**, see [the license](https://github.com/M66B/open-source-email/blob/master/LICENSE). +Error reporting is **opt-in**, see [here](https://github.com/M66B/open-source-email/blob/master/FAQ.md#user-content-faq104) for more information. + Copyright © 2018-2019 Marcel Bokhorst. diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index ce5dacc2ff..0f018b4655 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -47,6 +47,8 @@ import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.Button; +import android.widget.CheckBox; import android.widget.ImageView; import android.widget.ScrollView; import android.widget.Toast; @@ -412,6 +414,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB new Handler().post(checkIntent); checkFirst(); + checkBugsnag(); checkCrash(); pgpService = new OpenPgpServiceConnection(this, "org.sufficientlysecure.keychain"); @@ -670,6 +673,51 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } } + private void checkBugsnag() { + final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + if (prefs.getBoolean("first", true) || + prefs.getBoolean("crash_reports", false) || + prefs.getBoolean("crash_reports_confirmed", false)) + return; + + final View dview = LayoutInflater.from(this).inflate(R.layout.dialog_bugsnag, null); + final Button btnInfo = dview.findViewById(R.id.btnInfo); + final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain); + + final Intent info = new Intent(Intent.ACTION_VIEW); + info.setData(Uri.parse(Helper.FAQ_URI + "#user-content-faq104")); + info.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + + btnInfo.setVisibility( + info.resolveActivity(getPackageManager()) == null ? View.GONE : View.VISIBLE); + + btnInfo.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(info); + } + }); + + new DialogBuilderLifecycle(this, this) + .setView(dview) + .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + prefs.edit().putBoolean("crash_reports", true).apply(); + if (cbNotAgain.isChecked()) + prefs.edit().putBoolean("crash_reports_confirmed", true).apply(); + } + }) + .setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (cbNotAgain.isChecked()) + prefs.edit().putBoolean("crash_reports_confirmed", true).apply(); + } + }) + .show(); + } + private void checkCrash() { new SimpleTask() { @Override diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index a2d9c58151..3de11d2b4b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -62,7 +62,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc }; private final static String[] RESET_QUESTIONS = new String[]{ - "show_html_confirmed", "show_images_confirmed", "print_html_confirmed", "edit_ref_confirmed" + "show_html_confirmed", "show_images_confirmed", "print_html_confirmed", "edit_ref_confirmed", "crash_reports_confirmed" }; @Override diff --git a/app/src/main/res/layout/dialog_bugsnag.xml b/app/src/main/res/layout/dialog_bugsnag.xml new file mode 100644 index 0000000000..9994bf1f67 --- /dev/null +++ b/app/src/main/res/layout/dialog_bugsnag.xml @@ -0,0 +1,55 @@ + + + + + + + + + +