Merge "VNDK is fully deprecated from Soong" into main

This commit is contained in:
Kiyoung Kim 2024-06-04 00:48:12 +00:00 committed by Android (Google) Code Review
commit 48ebc86a8f
5 changed files with 2 additions and 42 deletions

View file

@ -1400,10 +1400,6 @@ func (c *config) PrebuiltHiddenApiDir(_ PathContext) string {
return String(c.productVariables.PrebuiltHiddenApiDir)
}
func (c *config) IsVndkDeprecated() bool {
return !Bool(c.productVariables.KeepVndk)
}
func (c *config) VendorApiLevel() string {
return String(c.productVariables.VendorApiLevel)
}

View file

@ -487,8 +487,6 @@ type ProductVariables struct {
ReleaseDefaultModuleBuildFromSource *bool `json:",omitempty"`
KeepVndk *bool `json:",omitempty"`
CheckVendorSeappViolations *bool `json:",omitempty"`
BuildFlags map[string]string `json:",omitempty"`

View file

@ -953,7 +953,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
// 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.
useVndk := a.SocSpecific() || a.DeviceSpecific() || (a.ProductSpecific() && mctx.Config().EnforceProductPartitionInterface())
excludeVndkLibs := useVndk && a.useVndkAsStable(mctx)
if proptools.Bool(a.properties.Use_vndk_as_stable) {
if !useVndk {
mctx.PropertyErrorf("use_vndk_as_stable", "not supported for system/system_ext APEXes")
@ -987,13 +986,8 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
if !android.IsDepInSameApex(mctx, parent, child) {
return false
}
if excludeVndkLibs {
if c, ok := child.(*cc.Module); ok && c.IsVndk() {
return false
}
}
if useVndk && mctx.Config().IsVndkDeprecated() && child.Name() == "libbinder" {
if useVndk && child.Name() == "libbinder" {
mctx.ModuleErrorf("Module %s in the vendor APEX %s should not use libbinder. Use libbinder_ndk instead.", parent.Name(), a.Name())
}
@ -2190,11 +2184,6 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext,
// tags used below are private (e.g. `cc.sharedDepTag`).
if cc.IsSharedDepTag(depTag) || cc.IsRuntimeDepTag(depTag) {
if ch, ok := child.(*cc.Module); ok {
if ch.UseVndk() && a.useVndkAsStable(ctx) && ch.IsVndk() {
vctx.requireNativeLibs = append(vctx.requireNativeLibs, ":vndk")
return false
}
af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
af.transitiveDep = true
@ -3015,12 +3004,3 @@ func rBcpPackages() map[string][]string {
func (a *apexBundle) IsTestApex() bool {
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)
}

View file

@ -1623,14 +1623,6 @@ func (ctx *moduleContextImpl) useSdk() bool {
func (ctx *moduleContextImpl) sdkVersion() string {
if ctx.ctx.Device() {
config := ctx.ctx.Config()
if !config.IsVndkDeprecated() && ctx.useVndk() {
vndkVer := ctx.mod.VndkVersion()
if inList(vndkVer, config.PlatformVersionActiveCodenames()) {
return "current"
}
return vndkVer
}
return String(ctx.mod.Properties.Sdk_version)
}
return ""
@ -1647,7 +1639,7 @@ func (ctx *moduleContextImpl) minSdkVersion() string {
if ctx.ctx.Device() {
config := ctx.ctx.Config()
if config.IsVndkDeprecated() && ctx.inVendor() {
if ctx.inVendor() {
// If building for vendor with final API, then use the latest _stable_ API as "current".
if config.VendorApiLevelFrozen() && (ver == "" || ver == "current") {
ver = config.PlatformSdkVersion().String()

View file

@ -1761,12 +1761,6 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) {
library.baseInstaller.subDir = "vndk"
}
}
// do not install vndk libs
// vndk libs are packaged into VNDK APEX
if ctx.isVndk() && !ctx.IsVndkExt() && !ctx.Config().IsVndkDeprecated() && !ctx.inProduct() {
return
}
} else if library.hasStubsVariants() && !ctx.Host() && ctx.directlyInAnyApex() {
// Bionic libraries (e.g. libc.so) is installed to the bootstrap subdirectory.
// The original path becomes a symlink to the corresponding file in the