Workaround bug where system clobbered StrictMode thread policy.
There is a bug (b/36951662) in many versions of the system where if you set the thread policy in Application.onCreate it could get clobbered.
When this happened, strict mode violations could sometimes go unreported.
This CL works around the problem by re-enabling our custom policy after onCreate by posting to the main thread.
Additionally, it copies most of java/com/google/android/libraries/strictmode/StrictModeUtils.java into our codebase and uses it to better handle known violations.
Finally, fixed or bypassed a few violations which were exposed by this change.
Bug: 64690143,64772057
Test: observed that certain strict mode violations which were flaky before now consistently reproduce
PiperOrigin-RevId: 165653027
Change-Id: If58966cfce251a22945f3aada6570b303c6af0ee
7 files changed