Guard Bugsnag delivery

pull/217/head
M66B 5 months ago
parent 161f96dc05
commit d69d0097ef

@ -35,6 +35,8 @@ internal class DefaultDelivery(
integrity: String?, integrity: String?,
headers: Map<String, String?> headers: Map<String, String?>
): DeliveryStatus { ): DeliveryStatus {
if (!System.getProperty("com.bugsnag.android.enabled").toBoolean())
return DeliveryStatus.FAILURE // Should not happen
TrafficStats.setThreadStatsTag(1) TrafficStats.setThreadStatsTag(1)
if (connectivity != null && !connectivity.hasNetworkConnection()) { if (connectivity != null && !connectivity.hasNetworkConnection()) {

@ -314,6 +314,7 @@ public class Log {
static void setCrashReporting(boolean enabled) { static void setCrashReporting(boolean enabled) {
try { try {
System.setProperty("com.bugsnag.android.enabled", Boolean.toString(enabled));
if (enabled) if (enabled)
Bugsnag.resumeSession(); Bugsnag.resumeSession();
else else
@ -589,8 +590,10 @@ public class Log {
Log.i("uuid=" + uuid); Log.i("uuid=" + uuid);
client.setUser(uuid, null, null); client.setUser(uuid, null, null);
if (prefs.getBoolean("crash_reports", false) || Log.isTestRelease()) if (prefs.getBoolean("crash_reports", false) || Log.isTestRelease()) {
System.setProperty("com.bugsnag.android.enabled", Boolean.toString(true));
Bugsnag.startSession(); Bugsnag.startSession();
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
/* /*

Loading…
Cancel
Save