Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent ANRs on background app event
Move calls to methods that do disk I/O from the main thread to a new background thread. There are reports where this can cause a significant amount of time on main thread. Any disk I/O is a risk on the main thread and should not be done as there is no upper bond of how long it can take. ANRs trigger after 5 seconds of the main thread being busy. The stacktrace of reported ANRs confirm that appStopped then calls getSessionInfluences which can result in waiting on disk I/O. We have also seen stacktraces with scheduling a AndroidX worker so that was moved into this background thread as well. I isn't known if it does any disk I/O but it was significant enough to show up in some ANRs
- Loading branch information