Merge "APEXes contain VNDK libraries when VNDK is deprecated" into main
This commit is contained in:
13
apex/apex.go
13
apex/apex.go
@@ -993,7 +993,7 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
|
|||||||
// the non-system APEXes because the VNDK libraries won't be included (and duped) in the
|
// the non-system APEXes because the VNDK libraries won't be included (and duped) in the
|
||||||
// APEX, but shared across APEXes via the VNDK APEX.
|
// APEX, but shared across APEXes via the VNDK APEX.
|
||||||
useVndk := a.SocSpecific() || a.DeviceSpecific() || (a.ProductSpecific() && mctx.Config().EnforceProductPartitionInterface())
|
useVndk := a.SocSpecific() || a.DeviceSpecific() || (a.ProductSpecific() && mctx.Config().EnforceProductPartitionInterface())
|
||||||
excludeVndkLibs := useVndk && proptools.Bool(a.properties.Use_vndk_as_stable)
|
excludeVndkLibs := useVndk && a.useVndkAsStable(mctx)
|
||||||
if proptools.Bool(a.properties.Use_vndk_as_stable) {
|
if proptools.Bool(a.properties.Use_vndk_as_stable) {
|
||||||
if !useVndk {
|
if !useVndk {
|
||||||
mctx.PropertyErrorf("use_vndk_as_stable", "not supported for system/system_ext APEXes")
|
mctx.PropertyErrorf("use_vndk_as_stable", "not supported for system/system_ext APEXes")
|
||||||
@@ -2394,7 +2394,7 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext,
|
|||||||
// tags used below are private (e.g. `cc.sharedDepTag`).
|
// tags used below are private (e.g. `cc.sharedDepTag`).
|
||||||
if cc.IsSharedDepTag(depTag) || cc.IsRuntimeDepTag(depTag) {
|
if cc.IsSharedDepTag(depTag) || cc.IsRuntimeDepTag(depTag) {
|
||||||
if ch, ok := child.(*cc.Module); ok {
|
if ch, ok := child.(*cc.Module); ok {
|
||||||
if ch.UseVndk() && proptools.Bool(a.properties.Use_vndk_as_stable) && ch.IsVndk() {
|
if ch.UseVndk() && a.useVndkAsStable(ctx) && ch.IsVndk() {
|
||||||
vctx.requireNativeLibs = append(vctx.requireNativeLibs, ":vndk")
|
vctx.requireNativeLibs = append(vctx.requireNativeLibs, ":vndk")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -3716,3 +3716,12 @@ func invalidCompileMultilib(ctx android.TopDownMutatorContext, value string) {
|
|||||||
func (a *apexBundle) IsTestApex() bool {
|
func (a *apexBundle) IsTestApex() bool {
|
||||||
return a.testApex
|
return a.testApex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *apexBundle) useVndkAsStable(ctx android.BaseModuleContext) bool {
|
||||||
|
// VNDK cannot be linked if it is deprecated
|
||||||
|
if ctx.Config().IsVndkDeprecated() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return proptools.Bool(a.properties.Use_vndk_as_stable)
|
||||||
|
}
|
||||||
|
@@ -3029,7 +3029,11 @@ func TestVendorApex_use_vndk_as_stable(t *testing.T) {
|
|||||||
vendor: true,
|
vendor: true,
|
||||||
shared_libs: ["libvndk", "libvendor"],
|
shared_libs: ["libvndk", "libvendor"],
|
||||||
}
|
}
|
||||||
`)
|
`,
|
||||||
|
android.FixtureModifyConfig(func(config android.Config) {
|
||||||
|
config.TestProductVariables.KeepVndk = proptools.BoolPtr(true)
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
vendorVariant := "android_vendor.29_arm64_armv8-a"
|
vendorVariant := "android_vendor.29_arm64_armv8-a"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user