Add "jni_libs" property to apex module

Which is the list of JNI libraries that are embeded inside the apex.
jni_libs is handled just like native_shared_libs except that it is
stored in apex_manifest.

When linkerconfig finds an apex with JNI libs, it exposes the namespace
for the apex as visible so that libnativeloader can link the namespace
to the corresponding classloader-namespace.

Bug: 149363889
Test: m nothing(runs soong test)
Change-Id: I52ebe38b44545e6e8853e34a3404a235c858112a
This commit is contained in:
Jooyung Han
2020-02-27 13:50:06 +09:00
parent 01a868d096
commit 643adc4896
3 changed files with 109 additions and 5 deletions

View File

@@ -180,6 +180,17 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
optCommands = append(optCommands, "-v name "+*a.properties.Apex_name)
}
// collect jniLibs. Notice that a.filesInfo is already sorted
var jniLibs []string
for _, fi := range a.filesInfo {
if fi.isJniLib {
jniLibs = append(jniLibs, fi.builtFile.Base())
}
}
if len(jniLibs) > 0 {
optCommands = append(optCommands, "-a jniLibs "+strings.Join(jniLibs, " "))
}
ctx.Build(pctx, android.BuildParams{
Rule: apexManifestRule,
Input: manifestSrc,