Clean up ART APEX manifests.
manifest-art.json: Rely on the build system to populate all required
libs. Besides some duplicate entries, this drops libicuuc.so,
libicui18n.so, and libneuralnetworks.so from the required list. None of
those libraries are dependencies of the ART module itself, and hence
don't get loaded from the ART namespace. They used to be necessary
before linkerconfig supported creating links for JNI libs and from
public.libraries.txt, and when libnativeloader still defaulted to the
ART namespace for loading such libs.
test_apex_manifest.json: Used by test_com.android.art and should be
identical to manifest-art.json except for the version number. Besides
the above, this file contained several stale libraries.
Also try to configure proper runtime_libs dependencies for libart(d)
for the things it dlopen's from the ART namespace, although most
libraries cannot be listed there for various reasons.
Test: m droid deapexer
deapexer info \
out/target/product/vsoc_x86_64/system/apex/com.android.art.capex
Compare the output before and after this CL.
Test: m test_com.android.art deapexer
deapexer info \
out/target/product/vsoc_x86_64/obj/ETC/test_com.android.art_intermediates/test_com.android.art.apex
Compare the output before and after this CL.
Bug: 184148353
Change-Id: I0d9c2a090702a95551208aad4be97ea867004a3c
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 264a19a..dc4acc0 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -2046,6 +2046,10 @@
// a regular JNI libraries with a regular JNI_OnLoad. Most JNI libraries can
// just use System.loadLibrary, but libcore can't because it's the library
// that implements System.loadLibrary!
+ //
+ // By setting calling class to java.lang.Object, the caller location for these
+ // JNI libs is core-oj.jar in the ART APEX, and hence they are loaded from the
+ // com_android_art linker namespace.
// libicu_jni has to be initialized before libopenjdk{d} due to runtime dependency from
// libopenjdk{d} to Icu4cMetadata native methods in libicu_jni. See http://b/143888405