From 97974dfa041501baf222e11b379cff282e8c3c66 Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Wed, 22 May 2024 16:50:34 +0900 Subject: [PATCH] VNDK is fully deprecated from Soong VNDK is fully deprecated, so KeepVndk variable will have fixed value. This change removes KeepVndk config value, and updates any logic using the value as VNDK is always deprecated. Bug: 330100430 Test: Soong tests passed Ignore-AOSP-First: Resolve merge conflict Change-Id: I98b7590c059883e06bf3fb236d88966de64991d7 --- android/config.go | 4 ---- android/variable.go | 2 -- apex/apex.go | 22 +--------------------- cc/cc.go | 10 +--------- cc/library.go | 6 ------ 5 files changed, 2 insertions(+), 42 deletions(-) diff --git a/android/config.go b/android/config.go index 89f99c6c8..1105534a1 100644 --- a/android/config.go +++ b/android/config.go @@ -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) } diff --git a/android/variable.go b/android/variable.go index 9a9556314..6e7c9798f 100644 --- a/android/variable.go +++ b/android/variable.go @@ -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"` diff --git a/apex/apex.go b/apex/apex.go index 5f711cd7b..37cb1c266 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -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) -} diff --git a/cc/cc.go b/cc/cc.go index cb82f8610..5e15381eb 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -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() diff --git a/cc/library.go b/cc/library.go index b9c1466b6..7a5683493 100644 --- a/cc/library.go +++ b/cc/library.go @@ -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