summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go44
1 files changed, 9 insertions, 35 deletions
diff --git a/apex/apex.go b/apex/apex.go
index dc9b23698..754f8981e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -18,7 +18,6 @@ package apex
import (
"fmt"
- "log"
"path/filepath"
"regexp"
"sort"
@@ -490,6 +489,9 @@ type apexBundle struct {
javaApisUsedByModuleFile android.ModuleOutPath
aconfigFiles []android.Path
+
+ // Required modules, filled out during GenerateAndroidBuildActions and used in AndroidMk
+ required []string
}
// apexFileClass represents a type of file that can be included in APEX.
@@ -568,7 +570,7 @@ func newApexFile(ctx android.BaseModuleContext, builtFile android.Path, androidM
if module != nil {
ret.moduleDir = ctx.OtherModuleDir(module)
ret.partition = module.PartitionTag(ctx.DeviceConfig())
- ret.requiredModuleNames = module.RequiredModuleNames()
+ ret.requiredModuleNames = module.RequiredModuleNames(ctx)
ret.targetRequiredModuleNames = module.TargetRequiredModuleNames()
ret.hostRequiredModuleNames = module.HostRequiredModuleNames()
ret.multilib = module.Target().Arch.ArchType.Multilib
@@ -954,7 +956,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")
@@ -962,11 +963,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
if a.minSdkVersionValue(mctx) != "" {
mctx.PropertyErrorf("use_vndk_as_stable", "not supported when min_sdk_version is set")
}
- mctx.VisitDirectDepsWithTag(sharedLibTag, func(dep android.Module) {
- if c, ok := dep.(*cc.Module); ok && c.IsVndk() {
- mctx.PropertyErrorf("use_vndk_as_stable", "Trying to include a VNDK library(%s) while use_vndk_as_stable is true.", dep.Name())
- }
- })
if mctx.Failed() {
return
}
@@ -988,16 +984,9 @@ 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
- }
- }
- //TODO: b/296491928 Vendor APEX should use libbinder.ndk instead of libbinder once VNDK is fully deprecated.
- if useVndk && mctx.Config().IsVndkDeprecated() && child.Name() == "libbinder" {
- log.Print("Libbinder is linked from Vendor APEX ", a.Name(), " with module ", parent.Name())
- return false
+ 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())
}
// By default, all the transitive dependencies are collected, unless filtered out
@@ -1054,6 +1043,7 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
InApexModules: []string{a.Name()}, // could be com.mycompany.android.foo
ApexContents: []*android.ApexContents{apexContents},
TestApexes: testApexes,
+ BaseApexName: mctx.ModuleName(),
}
mctx.WalkDeps(func(child, parent android.Module) bool {
if !continueApexDepsWalk(child, parent) {
@@ -2195,15 +2185,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
- }
-
- //TODO: b/296491928 Vendor APEX should use libbinder.ndk instead of libbinder once VNDK is fully deprecated.
- if ch.InVendorOrProduct() && ctx.Config().IsVndkDeprecated() && child.Name() == "libbinder" {
- return false
- }
af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
af.transitiveDep = true
@@ -2449,6 +2430,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.provideApexExportsInfo(ctx)
a.providePrebuiltInfo(ctx)
+
+ a.required = a.RequiredModuleNames(ctx)
}
// Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file
@@ -3024,12 +3007,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)
-}