VNDK APEX contains related *.libraries.txt files
These files were highly coupled with vndk version, so having them inside
the corresponding VNDK APEX is reasonable.
These files are used by linkerconfig and libnativeloader. In the future,
they reference these files from and VNDK APEX.
Bug: 141450808
Test: m com.android.vndk.current
Change-Id: I055a979d2636ddd8844a0afff81f6ba441f7965e
diff --git a/apex/apex.go b/apex/apex.go
index 4e6827f..08ba293 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -249,6 +249,9 @@
if vndkApex, ok := vndkApexList[vndkVersion]; ok {
mctx.AddReverseDependency(mctx.Module(), sharedLibTag, vndkApex)
}
+ } else if a, ok := mctx.Module().(*apexBundle); ok && a.vndkApex {
+ vndkVersion := proptools.StringDefault(a.vndkProperties.Vndk_version, "current")
+ mctx.AddDependency(mctx.Module(), prebuiltTag, cc.VndkLibrariesTxtModules(vndkVersion)...)
}
}
@@ -975,7 +978,7 @@
return
}
-func getCopyManifestForPrebuiltEtc(prebuilt *android.PrebuiltEtc) (fileToCopy android.Path, dirInApex string) {
+func getCopyManifestForPrebuiltEtc(prebuilt android.PrebuiltEtcModule) (fileToCopy android.Path, dirInApex string) {
dirInApex = filepath.Join("etc", prebuilt.SubDir())
fileToCopy = prebuilt.OutputFile()
return
@@ -1131,7 +1134,7 @@
ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child))
}
case prebuiltTag:
- if prebuilt, ok := child.(*android.PrebuiltEtc); ok {
+ if prebuilt, ok := child.(android.PrebuiltEtcModule); ok {
fileToCopy, dirInApex := getCopyManifestForPrebuiltEtc(prebuilt)
filesInfo = append(filesInfo, apexFile{fileToCopy, depName, dirInApex, etc, prebuilt, nil})
return true