-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StrictMode Violation #652
Comments
I've moxed the init code to a new thread. However, ACRA will still make disk I/O on the main thread, if the main thread just crashed. I don't see a point to move this out to a secondary thread, as responsiveness cannot be achieved because of the crash. |
One reason to move it to a secondary thread is so that you do not have a |
While I see where you're coming from, I don't think compatibility with a debug tool justifies implementing an otherwise useless performance overhead. |
You might want to document that ACRA may have compatibility issues with In principle, this shouldn't be a problem in production, as you shouldn't be using Unfortunately, |
Writes. More specifically, we're writing out the crash report https://github.com/ACRA/acra/blob/master/acra-core/src/main/java/org/acra/builder/ReportExecutor.java#L262 I've just seen allowThreadDiskWrites() in the docs. I think calling this prior to the disk write should be a negligible overhead. |
Ah, I forgot that |
Reopen because I've noticed several cases where disk read/writes are done on the main thread. |
I was working on a sample showing how we can use the new
penaltyListener()
feature ofStrictMode
in Android P for loggingStrictMode
violations via ACRA. The good news is, it works! The bad news is, I found out not by my network violation... but ACRA's own disk I/O on the main application thread as part of startup:I'm just calling
ACRA.init(this);
inattachBaseContext()
, per the docs, using ACRA 5.1.1. I would assume it's ACRA's job to do that work on a background thread, particularly since the stack trace doesn't show signs of my code.Attached is the project that generated the above stack trace. I switched
StrictMode
topenaltyDeath()
instead ofpenaltyListener()
, though you could re-enable that if you wanted. As it stands, the app crashes on startup with the aboveStrictMode
violation.StrictMode-20180311.zip
Let me know if you need more info!
The text was updated successfully, but these errors were encountered: