Made Bugsbag sessions opt-in

This commit is contained in:
M66B
2019-05-10 11:03:01 +02:00
parent 0117ffb0cc
commit a39771129c
3 changed files with 12 additions and 1 deletions

View File

@@ -108,6 +108,7 @@ public class ApplicationEx extends Application {
else
config.setReleaseStage(BuildConfig.PLAY_STORE_RELEASE ? "stable/play" : "stable");
config.setAutoCaptureSessions(false);
config.setIgnoreClasses(new String[]{"javax.mail.MessageRemovedException"});
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
@@ -115,11 +116,13 @@ public class ApplicationEx extends Application {
config.beforeSend(new BeforeSend() {
@Override
public boolean run(@NonNull Report report) {
return prefs.getBoolean("crash_reports", false); // opt-out
return prefs.getBoolean("crash_reports", false); // opt-in
}
});
Bugsnag.init(this, config);
if (prefs.getBoolean("crash_reports", false))
Bugsnag.startSession();
upgrade(this);