Error reporting is opt-in

This commit is contained in:
M66B 2019-05-10 10:10:13 +02:00
parent b4069d2d15
commit aab3b4484c
6 changed files with 124 additions and 2 deletions

15
FAQ.md
View File

@ -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
<br />
<a name="faq104"></a>
**(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
<br />
## 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).

View File

@ -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 &copy; 2018-2019 Marcel Bokhorst.

View File

@ -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<Long>() {
@Override

View File

@ -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

View File

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="24dp">
<TextView
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_ask_bugsnag"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvExplanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_bugsnag_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" />
<Button
android:id="@+id/btnInfo"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_info"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvExplanation" />
<CheckBox
android:id="@+id/cbNotAgain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_no_ask_again"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnInfo" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

View File

@ -223,7 +223,7 @@
<string name="title_advanced_authentication">Show a warning when the receiving server could not authenticate the message</string>
<string name="title_advanced_paranoid">Extra privacy features</string>
<string name="title_advanced_updates">Check for updates</string>
<string name="title_advanced_crash_reports">Send crash reports</string>
<string name="title_advanced_crash_reports">Send error reports</string>
<string name="title_advanced_debug">Debug mode</string>
<string name="title_advanced_last_cleanup">Last cleanup: %1$s</string>
@ -435,6 +435,8 @@
<string name="title_ask_show_image">Showing images can leak privacy sensitive information</string>
<string name="title_ask_edit_ref">Edit reformatted replied/forwarded message text?</string>
<string name="title_ask_delete_local">Delete local messages which are stored on the remote server too?</string>
<string name="title_ask_bugsnag">Send error reports?</string>
<string name="title_bugsnag_hint">Error reporting will help improve FairEmail</string>
<string name="title_compose">Compose</string>
<string name="title_from">From:</string>