Improve Native Coverage latency

* The current implementation works by sending signal 37 to
the testing process and busy-looping for 60 seconds or until it
has witnessed the testing process act upon the signal. Sometimes
we miss the signal completely which leads to a 60 second overhead
to the test runtime. Changing the deadline is infeasible as we
don't have any estimation on how long does it take to dump the coverage.

* This CL improves the current implementation by completely eliminating both
problems, we don't busy loop instead we call directly the method to dump
the profile data to the disk and then we exit, there is an introduced
latency for loading the native library but that should be negligble.

* Maintained backward compatibility with previous use-case by falling
back to the old implementation if we fail to load the native library.

* The next step should be migrating everyone over to the new way and
incorprating this change directly into Soong so that it would add
the native library + java dependency to all of the targets.

Bug: 329680904
Test: atest NetHttpCoverageTests && confirmed that coverage did not change
Change-Id: I966f4e2923b75258831857af3d68bd72685d93f6
3 files changed
tree: a7e481a08d06be3b2e1ad790efad638dfaa1734b
  1. build/
  2. java/
  3. javatests/
  4. tools/
  5. .gitignore
  6. Android.bp
  7. OWNERS
  8. PREUPLOAD.cfg
  9. README.md
  10. TEST_MAPPING
README.md

frameworks/libs/modules-utils/

Libraries and utilities intended for use by module and framework code.

Since modules use the code in this project, it must adhere to mainline requirements, for example, by setting min_sdk_version in Soong modules.

Java code

This project uses a single source path for Java code. All Java code should go in the java directory with subdirectories corresponding to the java package. Android.bp files should go alongside the java source files, and should only include java source for a single java package to encourage good code hygiene.

Tests for java code should go in the javatests directory and follow the same structure.