Remove sdk_level dependency on libbase, libc++

Using sdk_level in a small (typically JNI) library that does not use
libbase or libc++ results in ~400kB of libraries to pull in, as it
depends on libbase and libc++.

Remove the dependency on libbase and libc++ by using NDK APIs and
C strings.

Test that a file that includes the headers can build by adding a
sdk_level_nosdk_static test library that is exercised in the unit test,
and does not build against any library. This ensures that new
dependencies are not added by mistake, as that test would fail to build.

Bug: 220819740
Test: atest unbounded_sdk_level_test
Change-Id: Iee0ca99dcdfdd87e3c2f53cfa313bb394ab31253
7 files changed
tree: b9d0ff2a723b202078ce4884022d8f200feab939
  1. build/
  2. java/
  3. javatests/
  4. tools/
  5. Android.bp
  6. OWNERS
  7. PREUPLOAD.cfg
  8. README.md
  9. 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.