Add instrumentation listener for native coverage
Due to current limitations native code coverage is not collected
automatically at the end of Java tests that use JNI. This is worked
around in tests by using an InstrumentationListener that manually
triggers coverage collection at the end of a run.
Add a common module utility for that task, so that all modules do not
need to have their own copy, as is currently the case for tests using
such an utility.
The NativeCoverageInstrumentationListener code is extracted from the
current ConscryptInstrumentationListener.
Bug: 185074329
Test: atest NetworkStackCoverageTests using the utility
Change-Id: I6ea9fb04bade2567c7079443e09710f69df2e9b8
2 files changed