|
|
@ -249,23 +249,9 @@ public class Log {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
Throwable ex = error.getException().getCause();
|
|
|
|
Throwable ex = error.getException().getCause();
|
|
|
|
if (shouldReport(ex)) {
|
|
|
|
if (ex == null)
|
|
|
|
error.addToTab("extra", "installer", installer == null ? "-" : installer);
|
|
|
|
|
|
|
|
error.addToTab("extra", "package", BuildConfig.APPLICATION_ID);
|
|
|
|
|
|
|
|
error.addToTab("extra", "fingerprint", fingerprint);
|
|
|
|
|
|
|
|
error.addToTab("extra", "thread", Thread.currentThread().getId());
|
|
|
|
|
|
|
|
error.addToTab("extra", "free", Log.getFreeMemMb());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String theme = prefs.getString("theme", "light");
|
|
|
|
|
|
|
|
error.addToTab("extra", "theme", theme);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean shouldReport(Throwable ex) {
|
|
|
|
|
|
|
|
if (ex instanceof MessagingException &&
|
|
|
|
if (ex instanceof MessagingException &&
|
|
|
|
(ex.getCause() instanceof IOException ||
|
|
|
|
(ex.getCause() instanceof IOException ||
|
|
|
|
ex.getCause() instanceof ProtocolException))
|
|
|
|
ex.getCause() instanceof ProtocolException))
|
|
|
@ -294,10 +280,22 @@ public class Log {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// Rate limit
|
|
|
|
// Rate limit
|
|
|
|
int count = prefs.getInt("crash_report_count", 0) + 1;
|
|
|
|
int count = prefs.getInt("crash_report_count", 0);
|
|
|
|
|
|
|
|
count++;
|
|
|
|
prefs.edit().putInt("crash_report_count", count).apply();
|
|
|
|
prefs.edit().putInt("crash_report_count", count).apply();
|
|
|
|
|
|
|
|
if (count > MAX_CRASH_REPORTS)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
error.addToTab("extra", "installer", installer == null ? "-" : installer);
|
|
|
|
|
|
|
|
error.addToTab("extra", "fingerprint", fingerprint);
|
|
|
|
|
|
|
|
error.addToTab("extra", "thread", Thread.currentThread().getId());
|
|
|
|
|
|
|
|
error.addToTab("extra", "free", Log.getFreeMemMb());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String theme = prefs.getString("theme", "light");
|
|
|
|
|
|
|
|
error.addToTab("extra", "theme", theme);
|
|
|
|
|
|
|
|
error.addToTab("extra", "package", BuildConfig.APPLICATION_ID);
|
|
|
|
|
|
|
|
|
|
|
|
return (count <= MAX_CRASH_REPORTS);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|