summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go66
1 files changed, 18 insertions, 48 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 754f8981e..a2c1f2c39 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -157,8 +157,7 @@ type apexBundleProperties struct {
// Default: true.
Installable *bool
- // If set true, VNDK libs are considered as stable libs and are not included in this APEX.
- // Should be only used in non-system apexes (e.g. vendor: true). Default is false.
+ // Deprecated. Do not use. TODO(b/350644693) remove this after removing all usage
Use_vndk_as_stable *bool
// The type of filesystem to use. Either 'ext4', 'f2fs' or 'erofs'. Default 'ext4'.
@@ -748,9 +747,9 @@ func (a *apexBundle) getImageVariationPair() (string, string) {
prefix := android.CoreVariation
if a.SocSpecific() || a.DeviceSpecific() {
- prefix = cc.VendorVariation
+ prefix = android.VendorVariation
} else if a.ProductSpecific() {
- prefix = cc.ProductVariation
+ prefix = android.ProductVariation
}
return prefix, ""
@@ -950,24 +949,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
return
}
- // Special casing for APEXes on non-system (e.g., vendor, odm, etc.) partitions. They are
- // provided with a property named use_vndk_as_stable, which when set to true doesn't collect
- // VNDK libraries as transitive dependencies. This option is useful for reducing the size of
- // 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())
- if proptools.Bool(a.properties.Use_vndk_as_stable) {
- if !useVndk {
- mctx.PropertyErrorf("use_vndk_as_stable", "not supported for system/system_ext APEXes")
- }
- if a.minSdkVersionValue(mctx) != "" {
- mctx.PropertyErrorf("use_vndk_as_stable", "not supported when min_sdk_version is set")
- }
- if mctx.Failed() {
- return
- }
- }
-
continueApexDepsWalk := func(child, parent android.Module) bool {
am, ok := child.(android.ApexModule)
if !ok || !am.CanHaveApexVariants() {
@@ -985,10 +966,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
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
// above.
return true
@@ -1172,6 +1149,7 @@ var (
"test_com.android.os.statsd",
"test_com.android.permission",
"test_com.android.wifi",
+ "test_imgdiag_com.android.art",
"test_jitzygote_com.android.art",
// go/keep-sorted end
}
@@ -1370,25 +1348,6 @@ func (a *apexBundle) DepIsInSameApex(_ android.BaseModuleContext, _ android.Modu
return true
}
-var _ android.OutputFileProducer = (*apexBundle)(nil)
-
-// Implements android.OutputFileProducer
-func (a *apexBundle) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "", android.DefaultDistTag:
- // This is the default dist path.
- return android.Paths{a.outputFile}, nil
- case imageApexSuffix:
- // uncompressed one
- if a.outputApexFile != nil {
- return android.Paths{a.outputApexFile}, nil
- }
- fallthrough
- default:
- return nil, fmt.Errorf("unsupported module reference tag %q", tag)
- }
-}
-
var _ multitree.Exportable = (*apexBundle)(nil)
func (a *apexBundle) Exportable() bool {
@@ -2432,6 +2391,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
a.providePrebuiltInfo(ctx)
a.required = a.RequiredModuleNames(ctx)
+
+ a.setOutputFiles(ctx)
}
// Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file
@@ -2460,6 +2421,18 @@ func (a *apexBundle) provideApexExportsInfo(ctx android.ModuleContext) {
})
}
+// Set output files to outputFiles property, which is later used to set the
+// OutputFilesProvider
+func (a *apexBundle) setOutputFiles(ctx android.ModuleContext) {
+ // default dist path
+ ctx.SetOutputFiles(android.Paths{a.outputFile}, "")
+ ctx.SetOutputFiles(android.Paths{a.outputFile}, android.DefaultDistTag)
+ // uncompressed one
+ if a.outputApexFile != nil {
+ ctx.SetOutputFiles(android.Paths{a.outputApexFile}, imageApexSuffix)
+ }
+}
+
// apexBootclasspathFragmentFiles returns the list of apexFile structures defining the files that
// the bootclasspath_fragment contributes to the apex.
func apexBootclasspathFragmentFiles(ctx android.ModuleContext, module blueprint.Module) []apexFile {
@@ -2722,9 +2695,6 @@ func (a *apexBundle) checkUpdatable(ctx android.ModuleContext) {
if a.UsePlatformApis() {
ctx.PropertyErrorf("updatable", "updatable APEXes can't use platform APIs")
}
- if proptools.Bool(a.properties.Use_vndk_as_stable) {
- ctx.PropertyErrorf("use_vndk_as_stable", "updatable APEXes can't use external VNDK libs")
- }
if a.FutureUpdatable() {
ctx.PropertyErrorf("future_updatable", "Already updatable. Remove `future_updatable: true:`")
}