Merge "check exported flags when building all_aconfig_declarations" into main
diff --git a/aconfig/all_aconfig_declarations.go b/aconfig/all_aconfig_declarations.go
index 31616d8..f3c68c3 100644
--- a/aconfig/all_aconfig_declarations.go
+++ b/aconfig/all_aconfig_declarations.go
@@ -144,7 +144,7 @@
// Find all of the aconfig_declarations modules
var packages = make(map[string]int)
var cacheFiles android.Paths
- ctx.VisitAllModules(func(module android.Module) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
decl, ok := android.OtherModuleProvider(ctx, module, android.AconfigReleaseDeclarationsProviderKey)
if !ok {
return
diff --git a/aconfig/build_flags/build_flags_singleton.go b/aconfig/build_flags/build_flags_singleton.go
index e375d9c..3a06e72 100644
--- a/aconfig/build_flags/build_flags_singleton.go
+++ b/aconfig/build_flags/build_flags_singleton.go
@@ -15,8 +15,9 @@
package build_flags
import (
- "android/soong/android"
"fmt"
+
+ "android/soong/android"
)
// A singleton module that collects all of the build flags declared in the
@@ -42,7 +43,7 @@
var flagsFiles android.Paths
// Find all of the release_config_contribution modules
var contributionDirs android.Paths
- ctx.VisitAllModules(func(module android.Module) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
decl, ok := android.OtherModuleProvider(ctx, module, BuildFlagDeclarationsProviderKey)
if ok {
flagsFiles = append(flagsFiles, decl.IntermediateCacheOutputPath)
diff --git a/android/aconfig_providers.go b/android/aconfig_providers.go
index 7185a89..9c71d92 100644
--- a/android/aconfig_providers.go
+++ b/android/aconfig_providers.go
@@ -248,7 +248,7 @@
// Please only access the module's internal data through providers.
func getContainerUsingProviders(ctx OtherModuleProviderContext, m Module) string {
container := "system"
- commonInfo, _ := OtherModuleProvider(ctx, m, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, m, CommonModuleInfoProvider)
if commonInfo.Vendor || commonInfo.Proprietary || commonInfo.SocSpecific {
container = "vendor"
} else if commonInfo.ProductSpecific {
diff --git a/android/all_teams.go b/android/all_teams.go
index 8b55ade..5e76e53 100644
--- a/android/all_teams.go
+++ b/android/all_teams.go
@@ -116,7 +116,7 @@
testOnly: testModInfo.TestOnly,
topLevelTestTarget: testModInfo.TopLevelTarget,
kind: ctx.ModuleType(module),
- teamName: OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).Team,
+ teamName: OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoProvider).Team,
}
t.teams_for_mods[module.Name()] = entry
diff --git a/android/androidmk.go b/android/androidmk.go
index e4366fa..84eef62 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -880,7 +880,7 @@
}
}
- commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoProvider)
if commonInfo.SkipAndroidMkProcessing {
continue
}
@@ -1312,7 +1312,7 @@
// Please only access the module's internal data through providers.
func translateAndroidMkEntriesInfoModule(ctx SingletonContext, w io.Writer, moduleInfoJSONs *[]*ModuleInfoJSON,
mod Module, providerInfo *AndroidMkProviderInfo) error {
- commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoProvider)
if commonInfo.SkipAndroidMkProcessing {
return nil
}
diff --git a/android/apex.go b/android/apex.go
index 39de6de..57baff5 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -695,7 +695,7 @@
// Function called while walking an APEX's payload dependencies.
//
// Return true if the `to` module should be visited, false otherwise.
-type PayloadDepsCallback func(ctx BaseModuleContext, from Module, to ApexModule, externalDep bool) bool
+type PayloadDepsCallback func(ctx BaseModuleContext, from, to ModuleProxy, externalDep bool) bool
type WalkPayloadDepsFunc func(ctx BaseModuleContext, do PayloadDepsCallback)
// ModuleWithMinSdkVersionCheck represents a module that implements min_sdk_version checks
@@ -723,7 +723,7 @@
return
}
- walk(ctx, func(ctx BaseModuleContext, from Module, to ApexModule, externalDep bool) bool {
+ walk(ctx, func(ctx BaseModuleContext, from, to ModuleProxy, externalDep bool) bool {
if externalDep {
// external deps are outside the payload boundary, which is "stable"
// interface. We don't have to check min_sdk_version for external
@@ -733,7 +733,7 @@
if !IsDepInSameApex(ctx, from, to) {
return false
}
- if info, ok := OtherModuleProvider(ctx, to, CommonModuleInfoKey); ok && info.ModuleWithMinSdkVersionCheck {
+ if info, ok := OtherModuleProvider(ctx, to, CommonModuleInfoProvider); ok && info.ModuleWithMinSdkVersionCheck {
if info.MinSdkVersion.ApiLevel == nil || !info.MinSdkVersion.ApiLevel.Specified() {
// This dependency performs its own min_sdk_version check, just make sure it sets min_sdk_version
// to trigger the check.
@@ -765,7 +765,7 @@
// implementing this interface should provide an implementation. A module supports an sdk
// version when the module's min_sdk_version is equal to or less than the given sdk version.
func ShouldSupportSdkVersion(ctx BaseModuleContext, module Module, sdkVersion ApiLevel) error {
- info, ok := OtherModuleProvider(ctx, module, CommonModuleInfoKey)
+ info, ok := OtherModuleProvider(ctx, module, CommonModuleInfoProvider)
if !ok || info.MinSdkVersionSupported.IsNone() {
return fmt.Errorf("min_sdk_version is not specified")
}
diff --git a/android/base_module_context.go b/android/base_module_context.go
index d2404fd..eba3670 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -410,7 +410,7 @@
return &aModule
}
- if !OtherModuleProviderOrDefault(b, module, CommonModuleInfoKey).Enabled {
+ if !OtherModuleProviderOrDefault(b, module, CommonModuleInfoProvider).Enabled {
if t, ok := tag.(AllowDisabledModuleDependency); !ok || !t.AllowDisabledModuleDependencyProxy(b, aModule) {
if b.Config().AllowMissingDependencies() {
b.AddMissingDependencies([]string{b.OtherModuleName(aModule)})
@@ -440,7 +440,7 @@
func (b *baseModuleContext) getDirectDepsProxyInternal(name string, tag blueprint.DependencyTag) []ModuleProxy {
var deps []ModuleProxy
b.VisitDirectDepsProxy(func(module ModuleProxy) {
- if OtherModuleProviderOrDefault(b, module, CommonModuleInfoKey).BaseModuleName == name {
+ if OtherModuleProviderOrDefault(b, module, CommonModuleInfoProvider).BaseModuleName == name {
returnedTag := b.OtherModuleDependencyTag(module)
if tag == nil || returnedTag == tag {
deps = append(deps, module)
diff --git a/android/compliance_metadata.go b/android/compliance_metadata.go
index 7c0ab85..c15a206 100644
--- a/android/compliance_metadata.go
+++ b/android/compliance_metadata.go
@@ -18,7 +18,9 @@
"bytes"
"encoding/csv"
"fmt"
+ "path/filepath"
"slices"
+ "sort"
"strconv"
"strings"
@@ -127,32 +129,37 @@
// dependencies, built/installed files, etc. It is a wrapper on a map[string]string with some utility
// methods to get/set properties' values.
type ComplianceMetadataInfo struct {
- properties map[string]string
- filesContained []string
+ properties map[string]string
+ filesContained []string
+ prebuiltFilesCopied []string
}
type complianceMetadataInfoGob struct {
- Properties map[string]string
- FilesContained []string
+ Properties map[string]string
+ FilesContained []string
+ PrebuiltFilesCopied []string
}
func NewComplianceMetadataInfo() *ComplianceMetadataInfo {
return &ComplianceMetadataInfo{
- properties: map[string]string{},
- filesContained: make([]string, 0),
+ properties: map[string]string{},
+ filesContained: make([]string, 0),
+ prebuiltFilesCopied: make([]string, 0),
}
}
func (m *ComplianceMetadataInfo) ToGob() *complianceMetadataInfoGob {
return &complianceMetadataInfoGob{
- Properties: m.properties,
- FilesContained: m.filesContained,
+ Properties: m.properties,
+ FilesContained: m.filesContained,
+ PrebuiltFilesCopied: m.prebuiltFilesCopied,
}
}
func (m *ComplianceMetadataInfo) FromGob(data *complianceMetadataInfoGob) {
m.properties = data.Properties
m.filesContained = data.FilesContained
+ m.prebuiltFilesCopied = data.PrebuiltFilesCopied
}
func (c *ComplianceMetadataInfo) GobEncode() ([]byte, error) {
@@ -182,6 +189,14 @@
return c.filesContained
}
+func (c *ComplianceMetadataInfo) SetPrebuiltFilesCopied(files []string) {
+ c.prebuiltFilesCopied = files
+}
+
+func (c *ComplianceMetadataInfo) GetPrebuiltFilesCopied() []string {
+ return c.prebuiltFilesCopied
+}
+
func (c *ComplianceMetadataInfo) getStringValue(propertyName string) string {
if !slices.Contains(COMPLIANCE_METADATA_PROPS, propertyName) {
panic(fmt.Errorf("Unknown metadata property: %s.", propertyName))
@@ -289,7 +304,7 @@
rowId := -1
ctx.VisitAllModuleProxies(func(module ModuleProxy) {
- commonInfo, _ := OtherModuleProvider(ctx, module, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, module, CommonModuleInfoProvider)
if !commonInfo.Enabled {
return
}
@@ -329,24 +344,40 @@
makeMetadataCsv := PathForOutput(ctx, "compliance-metadata", deviceProduct, "make-metadata.csv")
makeModulesCsv := PathForOutput(ctx, "compliance-metadata", deviceProduct, "make-modules.csv")
+ productOutPath := filepath.Join(ctx.Config().OutDir(), "target", "product", String(ctx.Config().productVariables.DeviceName))
if !ctx.Config().KatiEnabled() {
- // In soong-only build the installed file list is from android_device module
ctx.VisitAllModuleProxies(func(module ModuleProxy) {
- if androidDeviceInfo, ok := OtherModuleProvider(ctx, module, AndroidDeviceInfoProvider); !ok || !androidDeviceInfo.Main_device {
- return
- }
- if metadataInfo, ok := OtherModuleProvider(ctx, module, ComplianceMetadataProvider); ok {
- if len(metadataInfo.filesContained) > 0 {
- csvHeaders := "installed_file,module_path,is_soong_module,is_prebuilt_make_module,product_copy_files,kernel_module_copy_files,is_platform_generated,static_libs,whole_static_libs,license_text"
- csvContent := make([]string, 0, len(metadataInfo.filesContained)+1)
- csvContent = append(csvContent, csvHeaders)
- for _, file := range metadataInfo.filesContained {
- csvContent = append(csvContent, file+",,Y,,,,,,,")
+ // In soong-only build the installed file list is from android_device module
+ if androidDeviceInfo, ok := OtherModuleProvider(ctx, module, AndroidDeviceInfoProvider); ok && androidDeviceInfo.Main_device {
+ if metadataInfo, ok := OtherModuleProvider(ctx, module, ComplianceMetadataProvider); ok {
+ if len(metadataInfo.filesContained) > 0 || len(metadataInfo.prebuiltFilesCopied) > 0 {
+ allFiles := make([]string, 0, len(metadataInfo.filesContained)+len(metadataInfo.prebuiltFilesCopied))
+ allFiles = append(allFiles, metadataInfo.filesContained...)
+ prebuiltFilesSrcDest := make(map[string]string)
+ for _, srcDestPair := range metadataInfo.prebuiltFilesCopied {
+ prebuiltFilePath := filepath.Join(productOutPath, strings.Split(srcDestPair, ":")[1])
+ allFiles = append(allFiles, prebuiltFilePath)
+ prebuiltFilesSrcDest[prebuiltFilePath] = srcDestPair
+ }
+ sort.Strings(allFiles)
+
+ csvHeaders := "installed_file,module_path,is_soong_module,is_prebuilt_make_module,product_copy_files,kernel_module_copy_files,is_platform_generated,static_libs,whole_static_libs,license_text"
+ csvContent := make([]string, 0, len(allFiles)+1)
+ csvContent = append(csvContent, csvHeaders)
+ for _, file := range allFiles {
+ if _, ok := prebuiltFilesSrcDest[file]; ok {
+ srcDestPair := prebuiltFilesSrcDest[file]
+ csvContent = append(csvContent, file+",,,,"+srcDestPair+",,,,,")
+ } else {
+ csvContent = append(csvContent, file+",,Y,,,,,,,")
+ }
+ }
+
+ WriteFileRuleVerbatim(ctx, makeMetadataCsv, strings.Join(csvContent, "\n"))
+ WriteFileRuleVerbatim(ctx, makeModulesCsv, "name,module_path,module_class,module_type,static_libs,whole_static_libs,built_files,installed_files")
}
- WriteFileRuleVerbatim(ctx, makeMetadataCsv, strings.Join(csvContent, "\n"))
- WriteFileRuleVerbatim(ctx, makeModulesCsv, "name,module_path,module_class,module_type,static_libs,whole_static_libs,built_files,installed_files")
+ return
}
- return
}
})
}
diff --git a/android/container.go b/android/container.go
index a5aab79..5d223b8 100644
--- a/android/container.go
+++ b/android/container.go
@@ -39,7 +39,7 @@
// Returns true if the dependency module is a stubs module
var depIsStubsModule exceptionHandleFunc = func(mctx ModuleContext, _ Module, dep ModuleProxy) bool {
- return OtherModuleProviderOrDefault(mctx, dep, CommonModuleInfoKey).IsStubsModule
+ return OtherModuleProviderOrDefault(mctx, dep, CommonModuleInfoProvider).IsStubsModule
}
// Returns true if the dependency module belongs to any of the apexes.
@@ -474,7 +474,7 @@
if _, ok := ctx.Module().(InstallableModule); ok {
containersInfo, _ := getContainerModuleInfo(ctx, ctx.Module())
ctx.VisitDirectDepsProxy(func(dep ModuleProxy) {
- if !OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoKey).Enabled {
+ if !OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoProvider).Enabled {
return
}
diff --git a/android/gen_notice.go b/android/gen_notice.go
index 482b1e0..ae83118 100644
--- a/android/gen_notice.go
+++ b/android/gen_notice.go
@@ -60,7 +60,7 @@
for _, name := range gm.For {
mods := ctx.ModuleVariantsFromName(m, name)
for _, mod := range mods {
- if !OtherModuleProviderOrDefault(ctx, mod, CommonModuleInfoKey).Enabled { // don't depend on variants without build rules
+ if !OtherModuleProviderOrDefault(ctx, mod, CommonModuleInfoProvider).Enabled { // don't depend on variants without build rules
continue
}
modules = append(modules, mod)
diff --git a/android/license_metadata.go b/android/license_metadata.go
index d15dfa8..e79febb 100644
--- a/android/license_metadata.go
+++ b/android/license_metadata.go
@@ -65,7 +65,7 @@
var allDepMetadataDepSets []depset.DepSet[Path]
ctx.VisitDirectDepsProxy(func(dep ModuleProxy) {
- if !OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoKey).Enabled {
+ if !OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoProvider).Enabled {
return
}
diff --git a/android/logtags.go b/android/logtags.go
index 88d36ec..ef7a612 100644
--- a/android/logtags.go
+++ b/android/logtags.go
@@ -43,7 +43,7 @@
func (l *logtagsSingleton) GenerateBuildActions(ctx SingletonContext) {
var allLogtags Paths
ctx.VisitAllModuleProxies(func(module ModuleProxy) {
- if !OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).ExportedToMake {
+ if !OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoProvider).ExportedToMake {
return
}
if logtagsInfo, ok := OtherModuleProvider(ctx, module, LogtagsProviderKey); ok {
diff --git a/android/makevars.go b/android/makevars.go
index 692b27e..e1d947d 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -259,7 +259,7 @@
singletonDists.lock.Unlock()
ctx.VisitAllModuleProxies(func(m ModuleProxy) {
- commonInfo, _ := OtherModuleProvider(ctx, m, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, m, CommonModuleInfoProvider)
if provider, ok := OtherModuleProvider(ctx, m, ModuleMakeVarsInfoProvider); ok &&
commonInfo.Enabled {
mctx := &makeVarsContext{
diff --git a/android/module.go b/android/module.go
index a56fea3..3d643f9 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1483,7 +1483,7 @@
// Installation is still handled by Make, so anything hidden from Make is not
// installable.
info := OtherModuleProviderOrDefault(ctx, dep, InstallFilesProvider)
- commonInfo := OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoKey)
+ commonInfo := OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoProvider)
if !commonInfo.HideFromMake && !commonInfo.SkipInstall {
installDeps = append(installDeps, info.TransitiveInstallFiles)
}
@@ -1500,7 +1500,7 @@
// should also install the output files of the given dependency and dependency tag.
func isInstallDepNeeded(ctx ModuleContext, dep ModuleProxy) bool {
// Don't add a dependency from the platform to a library provided by an apex.
- if OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoKey).UninstallableApexPlatformVariant {
+ if OtherModuleProviderOrDefault(ctx, dep, CommonModuleInfoProvider).UninstallableApexPlatformVariant {
return false
}
// Only install modules if the dependency tag is an InstallDepNeeded tag.
@@ -1923,7 +1923,7 @@
IsPlatform bool
}
-var CommonModuleInfoKey = blueprint.NewProvider[CommonModuleInfo]()
+var CommonModuleInfoProvider = blueprint.NewProvider[CommonModuleInfo]()
type PrebuiltModuleInfo struct {
SourceExists bool
@@ -2331,7 +2331,7 @@
if mm, ok := m.module.(interface{ BaseModuleName() string }); ok {
commonData.BaseModuleName = mm.BaseModuleName()
}
- SetProvider(ctx, CommonModuleInfoKey, commonData)
+ SetProvider(ctx, CommonModuleInfoProvider, commonData)
if p, ok := m.module.(PrebuiltInterface); ok && p.Prebuilt() != nil {
SetProvider(ctx, PrebuiltModuleInfoProvider, PrebuiltModuleInfo{
SourceExists: p.Prebuilt().SourceExists(),
diff --git a/android/neverallow.go b/android/neverallow.go
index 8995a0f..eca8eb3 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -60,7 +60,8 @@
AddNeverAllowRules(createCcStubsRule())
AddNeverAllowRules(createProhibitHeaderOnlyRule())
AddNeverAllowRules(createLimitNdkExportRule()...)
- AddNeverAllowRules(createLimitDirgroupRule()...)
+ AddNeverAllowRules(createLimitDirgroupRules()...)
+ AddNeverAllowRules(createLimitGenruleRules()...)
AddNeverAllowRules(createFilesystemIsAutoGeneratedRule())
AddNeverAllowRules(createKotlinPluginRule()...)
AddNeverAllowRules(createPrebuiltEtcBpDefineRule())
@@ -287,45 +288,45 @@
}
}
-func createLimitDirgroupRule() []Rule {
- reason := "dirgroup module and dir_srcs / keep_gendir property of genrule is allowed only to Trusty build rule."
+func createLimitDirgroupRules() []Rule {
+ reason := "The dirgroup module can only be used with Trusty visibility"
+ scriptsDirsList := []string{"//trusty/vendor/google/aosp/scripts", "//trusty/vendor/google/proprietary/scripts"}
return []Rule{
NeverAllow().
ModuleType("dirgroup").
- WithMatcher("visibility", NotInList([]string{"//trusty/vendor/google/aosp/scripts", "//trusty/vendor/google/proprietary/scripts"})).Because(reason),
+ WithMatcher("visibility", NotInList(scriptsDirsList)).Because(reason),
NeverAllow().
ModuleType("dirgroup").
- WithoutMatcher("visibility", InAllowedList([]string{"//trusty/vendor/google/aosp/scripts", "//trusty/vendor/google/proprietary/scripts"})).Because(reason),
+ WithoutMatcher("visibility", InAllowedList(scriptsDirsList)).Because(reason),
+ }
+}
+
+func createLimitGenruleRules() []Rule {
+ dirSrcsReason := "The `dir_srcs` property in a `genrule` module can only be used by Trusty"
+ keepGendirReason := "The `keep_gendir` property in a `genrule` module can only be used by Trusty"
+ allowedModuleNameList := []string{
+ // Trusty TEE target names
+ "trusty_tee_package_goog",
+ "trusty_tee_package",
+ // Trusty vm target names
+ "trusty_test_vm_arm64.bin",
+ "trusty_test_vm_x86_64.elf",
+ "trusty_test_vm_os_arm64.bin",
+ "trusty_test_vm_os_x86_64.elf",
+ "trusty_security_vm_arm64.bin",
+ "trusty_security_vm_x86_64.elf",
+ "trusty_widevine_vm_arm64.bin",
+ "trusty_widevine_vm_x86_64.elf",
+ }
+ return []Rule{
NeverAllow().
ModuleType("genrule").
- // Trusty TEE target names
- Without("name", "trusty_tee_package_goog").
- Without("name", "trusty_tee_package").
- // Trusty vm target names
- Without("name", "trusty_test_vm_arm64.bin").
- Without("name", "trusty_test_vm_x86_64.elf").
- Without("name", "trusty_test_vm_os_arm64.bin").
- Without("name", "trusty_test_vm_os_x86_64.elf").
- Without("name", "trusty_security_vm_arm64.bin").
- Without("name", "trusty_security_vm_x86_64.elf").
- Without("name", "trusty_widevine_vm_arm64.bin").
- Without("name", "trusty_widevine_vm_x86_64.elf").
- WithMatcher("dir_srcs", isSetMatcherInstance).Because(reason),
+ WithoutMatcher("name", InAllowedList(allowedModuleNameList)).
+ WithMatcher("dir_srcs", isSetMatcherInstance).Because(dirSrcsReason),
NeverAllow().
ModuleType("genrule").
- // Trusty TEE target names
- Without("name", "trusty_tee_package_goog").
- Without("name", "trusty_tee_package").
- // Trusty vm target names
- Without("name", "trusty_test_vm_arm64.bin").
- Without("name", "trusty_test_vm_x86_64.elf").
- Without("name", "trusty_test_vm_os_arm64.bin").
- Without("name", "trusty_test_vm_os_x86_64.elf").
- Without("name", "trusty_security_vm_arm64.bin").
- Without("name", "trusty_security_vm_x86_64.elf").
- Without("name", "trusty_widevine_vm_arm64.bin").
- Without("name", "trusty_widevine_vm_x86_64.elf").
- With("keep_gendir", "true").Because(reason),
+ WithoutMatcher("name", InAllowedList(allowedModuleNameList)).
+ With("keep_gendir", "true").Because(keepGendirReason),
}
}
@@ -378,6 +379,8 @@
"prebuilt_sbin",
"prebuilt_system",
"prebuilt_first_stage_ramdisk",
+ "prebuilt_radio",
+ "prebuilt_gpu",
).
DefinedInBpFile().
Because("module type not allowed to be defined in bp file")
diff --git a/android/package.go b/android/package.go
index 42f17b1..0f6a767 100644
--- a/android/package.go
+++ b/android/package.go
@@ -62,7 +62,7 @@
}
func (p *packageModule) GenerateBuildActions(ctx blueprint.ModuleContext) {
- ctx.SetProvider(CommonModuleInfoKey, CommonModuleInfo{
+ ctx.SetProvider(CommonModuleInfoProvider, CommonModuleInfo{
Enabled: true,
PrimaryLicensesProperty: p.primaryLicensesProperty,
})
diff --git a/android/paths.go b/android/paths.go
index 9c0c9a2..f7fcd35 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -683,7 +683,7 @@
if module == nil {
return nil, missingDependencyError{[]string{moduleName}}
}
- if !OtherModuleProviderOrDefault(ctx, *module, CommonModuleInfoKey).Enabled {
+ if !OtherModuleProviderOrDefault(ctx, *module, CommonModuleInfoProvider).Enabled {
return nil, missingDependencyError{[]string{moduleName}}
}
diff --git a/android/prebuilt.go b/android/prebuilt.go
index 4a94c0b..1932225 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -358,7 +358,7 @@
}
func IsModulePreferredProxy(ctx OtherModuleProviderContext, module ModuleProxy) bool {
- if OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).ReplacedByPrebuilt {
+ if OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoProvider).ReplacedByPrebuilt {
// A source module that has been replaced by a prebuilt counterpart.
return false
}
@@ -397,7 +397,7 @@
// the right module. This function is only safe to call after all TransitionMutators
// have run, e.g. in GenerateAndroidBuildActions.
func PrebuiltGetPreferred(ctx BaseModuleContext, module Module) Module {
- if !OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).ReplacedByPrebuilt {
+ if !OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoProvider).ReplacedByPrebuilt {
return module
}
if _, ok := OtherModuleProvider(ctx, module, PrebuiltModuleInfoProvider); ok {
diff --git a/android/testing.go b/android/testing.go
index 1962fde..08c8083 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -1197,7 +1197,7 @@
info := OtherModuleProviderOrDefault(ctx, mod, AndroidMkInfoProvider)
aconfigUpdateAndroidMkInfos(ctx, mod, info)
- commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoKey)
+ commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoProvider)
info.PrimaryInfo.fillInEntries(ctx, mod, &commonInfo)
if len(info.ExtraInfo) > 0 {
for _, ei := range info.ExtraInfo {
diff --git a/android/variable.go b/android/variable.go
index 5bc0b29..853d8ef 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -216,6 +216,7 @@
Platform_display_version_name *string `json:",omitempty"`
Platform_version_name *string `json:",omitempty"`
Platform_sdk_version *int `json:",omitempty"`
+ Platform_sdk_minor_version *int `json:",omitempty"`
Platform_sdk_codename *string `json:",omitempty"`
Platform_sdk_version_or_codename *string `json:",omitempty"`
Platform_sdk_final *bool `json:",omitempty"`
diff --git a/apex/apex.go b/apex/apex.go
index 38ab012..dc44e58 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1502,7 +1502,7 @@
func apexFileForJavaModuleWithFile(ctx android.ModuleContext, module android.Module,
javaInfo *java.JavaInfo, dexImplementationJar android.Path) apexFile {
dirInApex := "javalib"
- commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider)
af := newApexFile(ctx, dexImplementationJar, commonInfo.BaseModuleName, dirInApex, javaSharedLib, module)
af.jacocoReportClassesFile = javaInfo.JacocoReportClassesFile
if lintInfo, ok := android.OtherModuleProvider(ctx, module, java.LintProvider); ok {
@@ -1607,35 +1607,8 @@
// to the child modules. Returning false makes the visit to continue in the sibling or the parent
// modules. This is used in check* functions below.
func (a *apexBundle) WalkPayloadDeps(ctx android.BaseModuleContext, do android.PayloadDepsCallback) {
- ctx.WalkDeps(func(child, parent android.Module) bool {
- am, ok := child.(android.ApexModule)
- if !ok || !am.CanHaveApexVariants() {
- return false
- }
-
- // Filter-out unwanted depedendencies
- depTag := ctx.OtherModuleDependencyTag(child)
- if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok {
- return false
- }
- if dt, ok := depTag.(*dependencyTag); ok && !dt.payload {
- return false
- }
- if depTag == android.RequiredDepTag {
- return false
- }
-
- externalDep := !android.IsDepInSameApex(ctx, parent, child)
-
- // Visit actually
- return do(ctx, parent, am, externalDep)
- })
-}
-
-func (a *apexBundle) WalkPayloadDepsProxy(ctx android.BaseModuleContext,
- do func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool) {
ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
- if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey).CanHaveApexVariants {
+ if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).CanHaveApexVariants {
return false
}
// Filter-out unwanted depedendencies
@@ -1848,7 +1821,7 @@
if _, ok := depTag.(android.ExcludeFromApexContentsTag); ok {
return false
}
- commonInfo := android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider)
if !commonInfo.Enabled {
return false
}
@@ -2557,7 +2530,7 @@
librariesDirectlyInApex[ctx.OtherModuleName(dep)] = true
})
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool {
if info, ok := android.OtherModuleProvider(ctx, to, cc.LinkableInfoProvider); ok {
// If `to` is not actually in the same APEX as `from` then it does not need
// apex_available and neither do any of its dependencies.
@@ -2671,7 +2644,7 @@
return
}
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool {
// As soon as the dependency graph crosses the APEX boundary, don't go further.
if externalDep {
return false
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go
index dabec49..0bf4ba7 100644
--- a/apex/apex_singleton.go
+++ b/apex/apex_singleton.go
@@ -164,7 +164,7 @@
prebuiltInfo, exists := android.OtherModuleProvider(ctx, m, android.PrebuiltInfoProvider)
// Use prebuiltInfoProvider to filter out non apex soong modules.
// Use HideFromMake to filter out the unselected variants of a specific apex.
- if exists && !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoKey).HideFromMake {
+ if exists && !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoProvider).HideFromMake {
prebuiltInfos = append(prebuiltInfos, prebuiltInfo)
}
})
diff --git a/apex/builder.go b/apex/builder.go
index 2fc4902..8042a3b 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1102,7 +1102,7 @@
}
depInfos := android.DepNameToDepInfoMap{}
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool {
if from.Name() == to.Name() {
// This can happen for cc.reuseObjTag. We are not interested in tracking this.
// As soon as the dependency graph crosses the APEX boundary, don't go further.
@@ -1111,7 +1111,7 @@
// Skip dependencies that are only available to APEXes; they are developed with updatability
// in mind and don't need manual approval.
- if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoKey).NotAvailableForPlatform {
+ if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoProvider).NotAvailableForPlatform {
return !externalDep
}
@@ -1129,7 +1129,7 @@
depInfos[to.Name()] = info
} else {
toMinSdkVersion := "(no version)"
- if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok &&
+ if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoProvider); ok &&
!info.MinSdkVersion.IsPlatform && info.MinSdkVersion.ApiLevel != nil {
toMinSdkVersion = info.MinSdkVersion.ApiLevel.String()
}
diff --git a/bloaty/bloaty.go b/bloaty/bloaty.go
index 26f2aa8..a076d47 100644
--- a/bloaty/bloaty.go
+++ b/bloaty/bloaty.go
@@ -84,8 +84,8 @@
func (singleton *sizesSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var deps android.Paths
- ctx.VisitAllModules(func(m android.Module) {
- if !m.ExportedToMake() {
+ ctx.VisitAllModuleProxies(func(m android.ModuleProxy) {
+ if !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoProvider).ExportedToMake {
return
}
filePaths, ok := android.OtherModuleProvider(ctx, m, fileSizeMeasurerKey)
diff --git a/cc/api_level.go b/cc/api_level.go
index deca723..fa8dfaf 100644
--- a/cc/api_level.go
+++ b/cc/api_level.go
@@ -31,11 +31,7 @@
case android.Arm64, android.X86_64:
return android.FirstLp64Version
case android.Riscv64:
- apiLevel, err := android.ApiLevelFromUser(ctx, "VanillaIceCream")
- if err != nil {
- panic(err)
- }
- return apiLevel
+ return android.FutureApiLevel
default:
panic(fmt.Errorf("Unknown arch %q", arch))
}
diff --git a/cc/cc.go b/cc/cc.go
index 4da1103..16e8df7 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -81,12 +81,13 @@
HeaderLibs []string
ImplementationModuleName *string
- BinaryDecoratorInfo *BinaryDecoratorInfo
- LibraryDecoratorInfo *LibraryDecoratorInfo
- TestBinaryInfo *TestBinaryInfo
- BenchmarkDecoratorInfo *BenchmarkDecoratorInfo
- ObjectLinkerInfo *ObjectLinkerInfo
- StubDecoratorInfo *StubDecoratorInfo
+ BinaryDecoratorInfo *BinaryDecoratorInfo
+ LibraryDecoratorInfo *LibraryDecoratorInfo
+ TestBinaryInfo *TestBinaryInfo
+ BenchmarkDecoratorInfo *BenchmarkDecoratorInfo
+ ObjectLinkerInfo *ObjectLinkerInfo
+ StubDecoratorInfo *StubDecoratorInfo
+ PrebuiltLibraryLinkerInfo *PrebuiltLibraryLinkerInfo
}
type BinaryDecoratorInfo struct{}
@@ -96,6 +97,7 @@
// Location of the static library in the sysroot. Empty if the library is
// not included in the NDK.
NdkSysrootPath android.Path
+ VndkFileName string
}
type SnapshotInfo struct {
@@ -120,6 +122,10 @@
NdkSysrootPath android.Path
}
+type PrebuiltLibraryLinkerInfo struct {
+ VndkFileName string
+}
+
type LibraryInfo struct {
BuildStubs bool
}
@@ -128,6 +134,13 @@
StubDecoratorInfo *StubDecoratorInfo
}
+type LocalOrGlobalFlagsInfo struct {
+ CommonFlags []string // Flags that apply to C, C++, and assembly source files
+ CFlags []string // Flags that apply to C and C++ source files
+ ConlyFlags []string // Flags that apply to C source files
+ CppFlags []string // Flags that apply to C++ source files
+}
+
// Common info about the cc module.
type CcInfo struct {
IsPrebuilt bool
@@ -148,6 +161,7 @@
StaticExecutable bool
Static bool
Shared bool
+ Header bool
HasStubsVariants bool
StubsVersion string
IsStubs bool
@@ -195,7 +209,11 @@
APIListCoverageXMLPath android.ModuleOutPath
// FuzzSharedLibraries returns the shared library dependencies for this module.
// Expects that IsFuzzModule returns true.
- FuzzSharedLibraries android.RuleBuilderInstalls
+ FuzzSharedLibraries android.RuleBuilderInstalls
+ IsVndkPrebuiltLibrary bool
+ HasLLNDKStubs bool
+ IsLLNDKMovedToApex bool
+ ImplementationModuleName string
}
var LinkableInfoProvider = blueprint.NewProvider[*LinkableInfo]()
@@ -2356,9 +2374,11 @@
case *binaryDecorator:
ccInfo.LinkerInfo.BinaryDecoratorInfo = &BinaryDecoratorInfo{}
case *libraryDecorator:
+ lk := c.linker.(*libraryDecorator)
ccInfo.LinkerInfo.LibraryDecoratorInfo = &LibraryDecoratorInfo{
- InjectBsslHash: Bool(c.linker.(*libraryDecorator).Properties.Inject_bssl_hash),
- NdkSysrootPath: c.linker.(*libraryDecorator).ndkSysrootPath,
+ InjectBsslHash: Bool(lk.Properties.Inject_bssl_hash),
+ NdkSysrootPath: lk.ndkSysrootPath,
+ VndkFileName: lk.getLibNameHelper(c.BaseModuleName(), true, false) + ".so",
}
case *testBinary:
ccInfo.LinkerInfo.TestBinaryInfo = &TestBinaryInfo{
@@ -2372,6 +2392,11 @@
}
case *stubDecorator:
ccInfo.LinkerInfo.StubDecoratorInfo = &StubDecoratorInfo{}
+ case *prebuiltLibraryLinker:
+ ccInfo.LinkerInfo.PrebuiltLibraryLinkerInfo = &PrebuiltLibraryLinkerInfo{
+ VndkFileName: c.linker.(*prebuiltLibraryLinker).getLibNameHelper(
+ c.BaseModuleName(), true, false) + ".so",
+ }
}
if s, ok := c.linker.(SnapshotInterface); ok {
@@ -2441,12 +2466,17 @@
Multilib: mod.Multilib(),
ImplementationModuleNameForMake: mod.ImplementationModuleNameForMake(),
Symlinks: mod.Symlinks(),
+ Header: mod.Header(),
+ IsVndkPrebuiltLibrary: mod.IsVndkPrebuiltLibrary(),
}
vi := mod.VersionedInterface()
if vi != nil {
info.IsStubsImplementationRequired = vi.IsStubsImplementationRequired()
info.APIListCoverageXMLPath = vi.GetAPIListCoverageXMLPath()
+ info.HasLLNDKStubs = vi.HasLLNDKStubs()
+ info.IsLLNDKMovedToApex = vi.IsLLNDKMovedToApex()
+ info.ImplementationModuleName = vi.ImplementationModuleName(mod.BaseModuleName())
}
if !mod.PreventInstall() && fuzz.IsValid(ctx, mod.FuzzModuleStruct()) && mod.IsFuzzModule() {
@@ -3388,7 +3418,7 @@
return
}
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
if commonInfo.Target.Os != ctx.Os() {
ctx.ModuleErrorf("OS mismatch between %q (%s) and %q (%s)", ctx.ModuleName(), ctx.Os().Name, depName, dep.Target().Os.Name)
return
@@ -3745,7 +3775,7 @@
// platform APIs, use stubs only when it is from an APEX (and not from
// platform) However, for host, ramdisk, vendor_ramdisk, recovery or
// bootstrap modules, always link to non-stub variant
- isNotInPlatform := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey).NotInPlatform
+ isNotInPlatform := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider).NotInPlatform
useStubs = isNotInPlatform && !bootstrap
} else {
diff --git a/cc/fuzz.go b/cc/fuzz.go
index 325354b..ba34387 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -486,7 +486,7 @@
sharedLibsInstallDirPrefix = "lib/vendor"
}
- commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider)
isHost := commonInfo.Target.Os.Class == android.Host
hostOrTargetString := "target"
if commonInfo.Target.HostCross {
diff --git a/cc/llndk_library.go b/cc/llndk_library.go
index 8ca3ca1..b119fda 100644
--- a/cc/llndk_library.go
+++ b/cc/llndk_library.go
@@ -82,11 +82,10 @@
func (s *movedToApexLlndkLibraries) GenerateBuildActions(ctx android.SingletonContext) {
// Make uses LLNDK_MOVED_TO_APEX_LIBRARIES to generate the linker config.
movedToApexLlndkLibrariesMap := make(map[string]bool)
- ctx.VisitAllModules(func(module android.Module) {
- if library := moduleVersionedInterface(module); library != nil && library.HasLLNDKStubs() {
- if library.IsLLNDKMovedToApex() {
- name := library.ImplementationModuleName(module.(*Module).BaseModuleName())
- movedToApexLlndkLibrariesMap[name] = true
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
+ if library, ok := android.OtherModuleProvider(ctx, module, LinkableInfoProvider); ok {
+ if library.HasLLNDKStubs && library.IsLLNDKMovedToApex {
+ movedToApexLlndkLibrariesMap[library.ImplementationModuleName] = true
}
}
})
@@ -151,14 +150,16 @@
etc.SetCommonPrebuiltEtcInfo(ctx, txt)
}
-func getVndkFileName(m *Module) (string, error) {
- if library, ok := m.linker.(*libraryDecorator); ok {
- return library.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil
+func getVndkFileName(info *LinkerInfo) (string, error) {
+ if info != nil {
+ if info.LibraryDecoratorInfo != nil {
+ return info.LibraryDecoratorInfo.VndkFileName, nil
+ }
+ if info.PrebuiltLibraryLinkerInfo != nil {
+ return info.PrebuiltLibraryLinkerInfo.VndkFileName, nil
+ }
}
- if prebuilt, ok := m.linker.(*prebuiltLibraryLinker); ok {
- return prebuilt.libraryDecorator.getLibNameHelper(m.BaseModuleName(), true, false) + ".so", nil
- }
- return "", fmt.Errorf("VNDK library should have libraryDecorator or prebuiltLibraryLinker as linker: %T", m.linker)
+ return "", fmt.Errorf("VNDK library should have libraryDecorator or prebuiltLibraryLinker as linker: %T", info)
}
func (txt *llndkLibrariesTxtModule) GenerateSingletonBuildActions(ctx android.SingletonContext) {
@@ -167,9 +168,17 @@
return
}
- ctx.VisitAllModules(func(m android.Module) {
- if c, ok := m.(*Module); ok && c.VendorProperties.IsLLNDK && !c.Header() && !c.IsVndkPrebuiltLibrary() {
- filename, err := getVndkFileName(c)
+ ctx.VisitAllModuleProxies(func(m android.ModuleProxy) {
+ ccInfo, ok := android.OtherModuleProvider(ctx, m, CcInfoProvider)
+ if !ok {
+ return
+ }
+ linkableInfo, ok := android.OtherModuleProvider(ctx, m, LinkableInfoProvider)
+ if !ok {
+ return
+ }
+ if linkableInfo.IsLlndk && !linkableInfo.Header && !linkableInfo.IsVndkPrebuiltLibrary {
+ filename, err := getVndkFileName(ccInfo.LinkerInfo)
if err != nil {
ctx.ModuleErrorf(m, "%s", err)
}
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go
index a9f26a4..a59cc11 100644
--- a/cc/ndk_abi.go
+++ b/cc/ndk_abi.go
@@ -40,7 +40,7 @@
func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
@@ -78,7 +78,7 @@
func (n *ndkAbiDiffSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index 34f6195..82a19d0 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -212,7 +212,7 @@
var licensePaths android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/cc/strip.go b/cc/strip.go
index a950df8..32ea38d 100644
--- a/cc/strip.go
+++ b/cc/strip.go
@@ -23,8 +23,9 @@
// StripProperties defines the type of stripping applied to the module.
type StripProperties struct {
Strip struct {
- // Device and host modules default to stripping enabled leaving mini debuginfo.
- // This can be disabled by setting none to true.
+ // Device modules default to stripping enabled leaving mini debuginfo.
+ // Host modules default to stripping disabled, but can be enabled by setting any other
+ // strip boolean property.
None *bool `android:"arch_variant"`
// all forces stripping everything, including the mini debug info.
@@ -50,7 +51,12 @@
// NeedsStrip determines if stripping is required for a module.
func (stripper *Stripper) NeedsStrip(actx android.ModuleContext) bool {
forceDisable := Bool(stripper.StripProperties.Strip.None)
- return !forceDisable
+ // Strip is enabled by default for device variants.
+ defaultEnable := actx.Device()
+ forceEnable := Bool(stripper.StripProperties.Strip.All) ||
+ Bool(stripper.StripProperties.Strip.Keep_symbols) ||
+ Bool(stripper.StripProperties.Strip.Keep_symbols_and_debug_frame)
+ return !forceDisable && (forceEnable || defaultEnable)
}
func (stripper *Stripper) strip(actx android.ModuleContext, in android.Path, out android.ModuleOutPath,
diff --git a/cc/tidy.go b/cc/tidy.go
index 8e7f899..e8e1dc2 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -220,7 +220,7 @@
// (1) Collect all obj/tidy files into OS-specific groups.
ctx.VisitAllModuleVariantProxies(module, func(variant android.ModuleProxy) {
- osName := android.OtherModuleProviderOrDefault(ctx, variant, android.CommonModuleInfoKey).Target.Os.Name
+ osName := android.OtherModuleProviderOrDefault(ctx, variant, android.CommonModuleInfoProvider).Target.Os.Name
info := android.OtherModuleProviderOrDefault(ctx, variant, CcObjectInfoProvider)
addToOSGroup(osName, info.ObjFiles, allObjFileGroups, subsetObjFileGroups)
addToOSGroup(osName, info.TidyFiles, allTidyFileGroups, subsetTidyFileGroups)
diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go
index af1d33d..7f50912 100644
--- a/dexpreopt/class_loader_context.go
+++ b/dexpreopt/class_loader_context.go
@@ -291,6 +291,11 @@
// For prebuilts, library should have the same name as the source module.
lib = android.RemoveOptionalPrebuiltPrefix(lib)
+ // Bootclasspath libraries should not be added to CLC.
+ if android.InList(lib, ctx.Config().BootJars()) {
+ return nil
+ }
+
devicePath := UnknownInstallLibraryPath
if installPath == nil {
if android.InList(lib, CompatUsesLibs) || android.InList(lib, OptionalCompatUsesLibs) {
diff --git a/dexpreopt/config.go b/dexpreopt/config.go
index f3c2b2c..9cec9db 100644
--- a/dexpreopt/config.go
+++ b/dexpreopt/config.go
@@ -465,7 +465,7 @@
func (d dex2oatDependencyTag) AllowDisabledModuleDependencyProxy(
ctx android.OtherModuleProviderContext, target android.ModuleProxy) bool {
return android.OtherModuleProviderOrDefault(
- ctx, target, android.CommonModuleInfoKey).ReplacedByPrebuilt
+ ctx, target, android.CommonModuleInfoProvider).ReplacedByPrebuilt
}
// Dex2oatDepTag represents the dependency onto the dex2oatd module. It is added to any module that
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index fad8f07..d0da728 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -65,6 +65,7 @@
ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
ctx.RegisterModuleType("prebuilt_overlay", PrebuiltOverlayFactory)
ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
+ ctx.RegisterModuleType("prebuilt_gpu", PrebuiltGPUFactory)
ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory)
ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory)
ctx.RegisterModuleType("prebuilt_renderscript_bitcode", PrebuiltRenderScriptBitcodeFactory)
@@ -73,6 +74,7 @@
ctx.RegisterModuleType("prebuilt_bin", PrebuiltBinaryFactory)
ctx.RegisterModuleType("prebuilt_wallpaper", PrebuiltWallpaperFactory)
ctx.RegisterModuleType("prebuilt_priv_app", PrebuiltPrivAppFactory)
+ ctx.RegisterModuleType("prebuilt_radio", PrebuiltRadioFactory)
ctx.RegisterModuleType("prebuilt_rfs", PrebuiltRfsFactory)
ctx.RegisterModuleType("prebuilt_framework", PrebuiltFrameworkFactory)
ctx.RegisterModuleType("prebuilt_res", PrebuiltResFactory)
@@ -831,6 +833,15 @@
return module
}
+// prebuilt_gpu is for a prebuilt artifact in <partition>/gpu directory.
+func PrebuiltGPUFactory() android.Module {
+ module := &PrebuiltEtc{}
+ InitPrebuiltEtcModule(module, "gpu")
+ // This module is device-only
+ android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst)
+ return module
+}
+
// prebuilt_dsp installs a DSP related file to <partition>/etc/dsp directory for system image.
// If soc_specific property is set to true, the DSP related file is installed to the
// vendor <partition>/dsp directory for vendor image.
@@ -921,6 +932,16 @@
return module
}
+// prebuilt_radio installs files in <partition>/radio directory.
+func PrebuiltRadioFactory() android.Module {
+ module := &PrebuiltEtc{}
+ InitPrebuiltEtcModule(module, "radio")
+ // This module is device-only
+ android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon)
+ android.InitDefaultableModule(module)
+ return module
+}
+
// prebuilt_rfs installs files in <partition>/rfs directory.
func PrebuiltRfsFactory() android.Module {
module := &PrebuiltEtc{}
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index b1f668d..22ad7cf 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -191,7 +191,7 @@
allInstalledModules := a.allInstalledModules(ctx)
a.apkCertsInfo = a.buildApkCertsInfo(ctx, allInstalledModules)
- a.kernelConfig, a.kernelVersion = a.extractKernelVersionAndConfigs(ctx)
+ a.kernelVersion, a.kernelConfig = a.extractKernelVersionAndConfigs(ctx)
a.miscInfo = a.addMiscInfo(ctx)
a.buildTargetFilesZip(ctx, allInstalledModules)
a.buildProguardZips(ctx, allInstalledModules)
@@ -294,18 +294,26 @@
}
func buildComplianceMetadata(ctx android.ModuleContext, tags ...blueprint.DependencyTag) {
+ // Collect metadata from deps
filesContained := make([]string, 0)
+ prebuiltFilesCopied := make([]string, 0)
for _, tag := range tags {
ctx.VisitDirectDepsProxyWithTag(tag, func(m android.ModuleProxy) {
if complianceMetadataInfo, ok := android.OtherModuleProvider(ctx, m, android.ComplianceMetadataProvider); ok {
filesContained = append(filesContained, complianceMetadataInfo.GetFilesContained()...)
+ prebuiltFilesCopied = append(prebuiltFilesCopied, complianceMetadataInfo.GetPrebuiltFilesCopied()...)
}
})
}
- sort.Strings(filesContained)
-
+ // Merge to module's ComplianceMetadataInfo
complianceMetadataInfo := ctx.ComplianceMetadataInfo()
+ filesContained = append(filesContained, complianceMetadataInfo.GetFilesContained()...)
+ sort.Strings(filesContained)
complianceMetadataInfo.SetFilesContained(filesContained)
+
+ prebuiltFilesCopied = append(prebuiltFilesCopied, complianceMetadataInfo.GetPrebuiltFilesCopied()...)
+ sort.Strings(prebuiltFilesCopied)
+ complianceMetadataInfo.SetPrebuiltFilesCopied(prebuiltFilesCopied)
}
// Returns a list of modules that are installed, which are collected from the dependency
@@ -673,7 +681,13 @@
}
if partition == "vendor_ramdisk" {
// Create vendor_boot_filesystem_config from the assembled VENDOR_BOOT/RAMDISK intermediates directory
- a.generateFilesystemConfigForTargetFiles(ctx, builder, nil, targetFilesDir.String(), targetFilesDir.String()+"/VENDOR_BOOT/RAMDISK", "vendor_boot_filesystem_config.txt")
+ vendorRamdiskStagingDir := targetFilesDir.String() + "/VENDOR_BOOT/RAMDISK"
+ vendorRamdiskFsConfigOut := targetFilesDir.String() + "/META/vendor_boot_filesystem_config.txt"
+ fsConfigBin := ctx.Config().HostToolPath(ctx, "fs_config")
+ builder.Command().Textf(
+ `(cd %s; find . -type d | sed 's,$,/,'; find . \! -type d) | cut -c 3- | sort | sed 's,^,,' | %s -C -D %s -R \"\" > %s`,
+ vendorRamdiskStagingDir, fsConfigBin, vendorRamdiskStagingDir, vendorRamdiskFsConfigOut).
+ Implicit(fsConfigBin)
}
}
// Copy ramdisk_node_list
@@ -881,11 +895,12 @@
Flag("--tools lz4:"+lz4tool.String()).Implicit(lz4tool).
FlagWithInput("--input ", kernel).
FlagWithOutput("--output-release ", extractedVersionFile).
- FlagWithOutput("--output-configs ", extractedConfigsFile)
+ FlagWithOutput("--output-configs ", extractedConfigsFile).
+ Textf(`&& printf "\n" >> %s`, extractedVersionFile)
if specifiedVersion := proptools.String(a.deviceProps.Kernel_version); specifiedVersion != "" {
specifiedVersionFile := android.PathForModuleOut(ctx, "specified_kernel_version.txt")
- android.WriteFileRuleVerbatim(ctx, specifiedVersionFile, specifiedVersion)
+ android.WriteFileRule(ctx, specifiedVersionFile, specifiedVersion)
builder.Command().Text("diff -q").
Input(specifiedVersionFile).
Input(extractedVersionFile).
@@ -926,7 +941,7 @@
apkCerts := []string{}
for _, installedModule := range allInstalledModules {
partition := ""
- if commonInfo, ok := android.OtherModuleProvider(ctx, installedModule, android.CommonModuleInfoKey); ok {
+ if commonInfo, ok := android.OtherModuleProvider(ctx, installedModule, android.CommonModuleInfoProvider); ok {
partition = commonInfo.PartitionTag
} else {
ctx.ModuleErrorf("%s does not set CommonModuleInfoKey", installedModule.Name())
@@ -935,7 +950,9 @@
apkCerts = append(apkCerts, formatLine(info.Certificate, info.InstallApkName+".apk", partition))
} else if info, ok := android.OtherModuleProvider(ctx, installedModule, java.AppInfosProvider); ok {
for _, certInfo := range info {
- apkCerts = append(apkCerts, formatLine(certInfo.Certificate, certInfo.InstallApkName+".apk", partition))
+ // Partition information of apk-in-apex is not exported to the legacy Make packaging system.
+ // Hardcode the partition to "system"
+ apkCerts = append(apkCerts, formatLine(certInfo.Certificate, certInfo.InstallApkName+".apk", "system"))
}
} else if info, ok := android.OtherModuleProvider(ctx, installedModule, java.RuntimeResourceOverlayInfoProvider); ok {
apkCerts = append(apkCerts, formatLine(info.Certificate, info.OutputFile.Base(), partition))
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go
index 2bf0d59..c06c200 100644
--- a/filesystem/bootimg.go
+++ b/filesystem/bootimg.go
@@ -201,7 +201,8 @@
return
}
- unsignedOutput := b.buildBootImage(ctx, b.getKernelPath(ctx))
+ kernelPath := b.getKernelPath(ctx)
+ unsignedOutput := b.buildBootImage(ctx, kernelPath)
output := unsignedOutput
if proptools.Bool(b.properties.Use_avb) {
@@ -212,7 +213,7 @@
case "default":
output = b.signImage(ctx, unsignedOutput)
case "make_legacy":
- output = b.addAvbFooter(ctx, unsignedOutput, b.getKernelPath(ctx))
+ output = b.addAvbFooter(ctx, unsignedOutput, kernelPath)
default:
ctx.PropertyErrorf("avb_mode", `Unknown value for avb_mode, expected "default" or "make_legacy", got: %q`, *b.properties.Avb_mode)
}
@@ -235,10 +236,11 @@
}
// Set BootimgInfo for building target_files.zip
+ dtbPath := b.getDtbPath(ctx)
android.SetProvider(ctx, BootimgInfoProvider, BootimgInfo{
Cmdline: b.properties.Cmdline,
- Kernel: b.getKernelPath(ctx),
- Dtb: b.getDtbPath(ctx),
+ Kernel: kernelPath,
+ Dtb: dtbPath,
Bootconfig: b.getBootconfigPath(ctx),
Output: output,
})
@@ -265,6 +267,16 @@
})
// Dump compliance metadata
+ complianceMetadataInfo := ctx.ComplianceMetadataInfo()
+ prebuiltFilesCopied := make([]string, 0)
+ if kernelPath != nil {
+ prebuiltFilesCopied = append(prebuiltFilesCopied, kernelPath.String()+":kernel")
+ }
+ if dtbPath != nil {
+ prebuiltFilesCopied = append(prebuiltFilesCopied, dtbPath.String()+":dtb.img")
+ }
+ complianceMetadataInfo.SetPrebuiltFilesCopied(prebuiltFilesCopied)
+
if ramdisk := proptools.String(b.properties.Ramdisk_module); ramdisk != "" {
buildComplianceMetadata(ctx, bootimgRamdiskDep)
}
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 065acbd..d5188d7 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -1469,7 +1469,7 @@
deps := f.gatherFilteredPackagingSpecs(ctx)
ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
- if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled {
return false
}
for _, ps := range android.OtherModuleProviderOrDefault(
@@ -1490,7 +1490,7 @@
var requireModules []android.ModuleProxy
ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
- if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, child, android.CommonModuleInfoProvider).Enabled {
return false
}
_, parentInPackage := modulesInPackageByModule[parent]
diff --git a/filesystem/super_image.go b/filesystem/super_image.go
index 9e4412c..5108025 100644
--- a/filesystem/super_image.go
+++ b/filesystem/super_image.go
@@ -200,6 +200,7 @@
miscInfoString.WriteString(value)
miscInfoString.WriteRune('\n')
}
+ addStr("ab_update", strconv.FormatBool(proptools.Bool(s.properties.Ab_update)))
subImageInfo := make(map[string]FilesystemInfo)
var deps android.Paths
@@ -329,8 +330,6 @@
addStr("super_partition_groups", strings.Join(groups, " "))
addStr("dynamic_partition_list", strings.Join(partitionList, " "))
- addStr("ab_update", strconv.FormatBool(proptools.Bool(s.properties.Ab_update)))
-
if proptools.Bool(s.properties.Virtual_ab.Enable) {
addStr("virtual_ab", "true")
if proptools.Bool(s.properties.Virtual_ab.Retrofit) {
diff --git a/fsgen/prebuilt_etc_modules_gen.go b/fsgen/prebuilt_etc_modules_gen.go
index e028b1d..2025c91 100644
--- a/fsgen/prebuilt_etc_modules_gen.go
+++ b/fsgen/prebuilt_etc_modules_gen.go
@@ -199,6 +199,7 @@
"etc/dsp": etc.PrebuiltDSPFactory,
"etc/firmware": etc.PrebuiltFirmwareFactory,
"firmware": etc.PrebuiltFirmwareFactory,
+ "gpu": etc.PrebuiltGPUFactory,
"first_stage_ramdisk": etc.PrebuiltFirstStageRamdiskFactory,
"fonts": etc.PrebuiltFontFactory,
"framework": etc.PrebuiltFrameworkFactory,
@@ -210,6 +211,7 @@
"optee": etc.PrebuiltOpteeFactory,
"overlay": etc.PrebuiltOverlayFactory,
"priv-app": etc.PrebuiltPrivAppFactory,
+ "radio": etc.PrebuiltRadioFactory,
"sbin": etc.PrebuiltSbinFactory,
"system": etc.PrebuiltSystemFactory,
"res": etc.PrebuiltResFactory,
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 6bd1fcc..e976e6b 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -113,7 +113,7 @@
func (t hostToolDependencyTag) AllowDisabledModuleDependencyProxy(
ctx android.OtherModuleProviderContext, target android.ModuleProxy) bool {
return android.OtherModuleProviderOrDefault(
- ctx, target, android.CommonModuleInfoKey).ReplacedByPrebuilt
+ ctx, target, android.CommonModuleInfoProvider).ReplacedByPrebuilt
}
var _ android.AllowDisabledModuleDependency = (*hostToolDependencyTag)(nil)
@@ -353,7 +353,7 @@
if h, ok := android.OtherModuleProvider(ctx, module, android.HostToolProviderInfoProvider); ok {
// A HostToolProvider provides the path to a tool, which will be copied
// into the sandbox.
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
if ctx.Config().AllowMissingDependencies() {
ctx.AddMissingDependencies([]string{tool})
} else {
diff --git a/java/app.go b/java/app.go
index 65ccc68..f1dcf41 100644
--- a/java/app.go
+++ b/java/app.go
@@ -531,7 +531,7 @@
if _, ok := android.OtherModuleProvider(ctx, m, cc.CcInfoProvider); !ok {
panic(fmt.Errorf("jni dependency is not a cc module: %v", m))
}
- commonInfo, ok := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoKey)
+ commonInfo, ok := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoProvider)
if !ok {
panic(fmt.Errorf("jni dependency doesn't have CommonModuleInfo provider: %v", m))
}
@@ -1229,7 +1229,7 @@
seenModulePaths := make(map[string]bool)
ctx.WalkDepsProxy(func(module, parent android.ModuleProxy) bool {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return false
}
otherName := ctx.OtherModuleName(module)
@@ -1249,7 +1249,7 @@
}
seenModulePaths[path.String()] = true
- commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider)
if checkNativeSdkVersion && commonInfo.SdkVersion == "" {
ctx.PropertyErrorf("jni_libs", "JNI dependency %q uses platform APIs, but this module does not",
otherName)
@@ -1287,13 +1287,13 @@
}
func (a *AndroidApp) WalkPayloadDeps(ctx android.BaseModuleContext, do android.PayloadDepsCallback) {
- ctx.WalkDeps(func(child, parent android.Module) bool {
+ ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
// TODO(ccross): Should this use android.DepIsInSameApex? Right now it is applying the android app
// heuristics to every transitive dependency, when it should probably be using the heuristics of the
// immediate parent.
isExternal := !a.GetDepInSameApexChecker().OutgoingDepIsInSameApex(ctx.OtherModuleDependencyTag(child))
- if am, ok := child.(android.ApexModule); ok {
- if !do(ctx, parent, am, isExternal) {
+ if am, ok := android.OtherModuleProvider(ctx, child, android.CommonModuleInfoProvider); ok && am.IsApexModule {
+ if !do(ctx, parent, child, isExternal) {
return false
}
}
@@ -1307,12 +1307,12 @@
}
depsInfo := android.DepNameToDepInfoMap{}
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from, to android.ModuleProxy, externalDep bool) bool {
depName := to.Name()
// Skip dependencies that are only available to APEXes; they are developed with updatability
// in mind and don't need manual approval.
- if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoKey).NotAvailableForPlatform {
+ if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoProvider).NotAvailableForPlatform {
return true
}
@@ -1322,7 +1322,7 @@
depsInfo[depName] = info
} else {
toMinSdkVersion := "(no version)"
- if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok &&
+ if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoProvider); ok &&
!info.MinSdkVersion.IsPlatform && info.MinSdkVersion.ApiLevel != nil {
toMinSdkVersion = info.MinSdkVersion.ApiLevel.String()
}
diff --git a/java/base.go b/java/base.go
index 0833831..19fb2bc 100644
--- a/java/base.go
+++ b/java/base.go
@@ -629,7 +629,7 @@
return nil
}
if info.SdkVersion.Kind == android.SdkCorePlatform {
- if useLegacyCorePlatformApi(ctx, android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).BaseModuleName) {
+ if useLegacyCorePlatformApi(ctx, android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).BaseModuleName) {
return fmt.Errorf("non stable SDK %v - uses legacy core platform", info.SdkVersion)
} else {
// Treat stable core platform as stable.
diff --git a/java/dexpreopt_check.go b/java/dexpreopt_check.go
index c971565..9d0f539 100644
--- a/java/dexpreopt_check.go
+++ b/java/dexpreopt_check.go
@@ -100,7 +100,12 @@
if systemServerJar.InstallInSystemExt() && ctx.Config().InstallApexSystemServerDexpreoptSamePartition() {
partition = ctx.DeviceConfig().SystemExtPath() // system_ext
}
- dexLocation := dexpreopt.GetSystemServerDexLocation(ctx, global, systemServerJar.Name())
+ var dexLocation string
+ if m, ok := systemServerJar.(ModuleWithStem); ok {
+ dexLocation = dexpreopt.GetSystemServerDexLocation(ctx, global, m.Stem())
+ } else {
+ ctx.PropertyErrorf("dexpreopt_systemserver_check", "%v is not a ModuleWithStem", systemServerJar.Name())
+ }
odexLocation := dexpreopt.ToOdexPath(dexLocation, targets[0].Arch.ArchType, partition)
odexPath := getInstallPath(ctx, odexLocation)
vdexPath := getInstallPath(ctx, pathtools.ReplaceExtension(odexLocation, "vdex"))
diff --git a/java/java.go b/java/java.go
index 215fbbd..235a27d 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2225,7 +2225,7 @@
// install these alongside the java binary.
ctx.VisitDirectDepsProxyWithTag(jniInstallTag, func(jni android.ModuleProxy) {
// Use the BaseModuleName of the dependency (without any prebuilt_ prefix)
- commonInfo, _ := android.OtherModuleProvider(ctx, jni, android.CommonModuleInfoKey)
+ commonInfo, _ := android.OtherModuleProvider(ctx, jni, android.CommonModuleInfoProvider)
j.androidMkNamesOfJniLibs = append(j.androidMkNamesOfJniLibs, commonInfo.BaseModuleName+":"+commonInfo.Target.Arch.ArchType.Bitness())
})
// Check that native libraries are not listed in `required`. Prompt users to use `jni_libs` instead.
diff --git a/java/java_test.go b/java/java_test.go
index 6df81e5..1ba78d4 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -3193,3 +3193,72 @@
deps := findDepsOfModule(res, res.ModuleForTests(t, "myjavabin", "android_common").Module(), "mynativelib")
android.AssertIntEquals(t, "Create a dep on the first variant", 1, len(deps))
}
+
+func TestBootJarNotInUsesLibs(t *testing.T) {
+ t.Parallel()
+ result := android.GroupFixturePreparers(
+ PrepareForTestWithJavaDefaultModules,
+ PrepareForTestWithJavaSdkLibraryFiles,
+ FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary"),
+ FixtureConfigureApexBootJars("myapex:mysdklibrary"),
+ ).RunTestWithBp(t, `
+ bootclasspath_fragment {
+ name: "myfragment",
+ contents: ["mysdklibrary"],
+ hidden_api: {
+ split_packages: ["*"],
+ },
+ }
+
+ java_sdk_library {
+ name: "mysdklibrary",
+ srcs: ["Test.java"],
+ compile_dex: true,
+ public: {enabled: true},
+ min_sdk_version: "2",
+ permitted_packages: ["mysdklibrary"],
+ sdk_version: "current",
+ }
+
+ java_sdk_library {
+ name: "myothersdklibrary",
+ srcs: ["Test.java"],
+ compile_dex: true,
+ public: {enabled: true},
+ min_sdk_version: "2",
+ permitted_packages: ["myothersdklibrary"],
+ sdk_version: "current",
+ }
+
+ java_library {
+ name: "foo",
+ libs: [
+ "bar",
+ "mysdklibrary.stubs",
+ ],
+ srcs: ["A.java"],
+ }
+
+ java_library {
+ name: "bar",
+ libs: [
+ "myothersdklibrary.stubs"
+ ],
+ }
+ `)
+ ctx := result.TestContext
+ fooModule := ctx.ModuleForTests(t, "foo", "android_common")
+
+ androidMkEntries := android.AndroidMkEntriesForTest(t, ctx, fooModule.Module())[0]
+ localExportSdkLibraries := androidMkEntries.EntryMap["LOCAL_EXPORT_SDK_LIBRARIES"]
+ android.AssertStringListDoesNotContain(t,
+ "boot jar should not be included in uses libs entries",
+ localExportSdkLibraries,
+ "mysdklibrary",
+ )
+ android.AssertStringListContains(t,
+ "non boot jar is included in uses libs entries",
+ localExportSdkLibraries,
+ "myothersdklibrary",
+ )
+}
diff --git a/java/jdeps.go b/java/jdeps.go
index 4711dc1..7ef6c89 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -46,7 +46,7 @@
moduleInfos := make(map[string]android.IdeInfo)
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
diff --git a/java/lint.go b/java/lint.go
index c31dfd0..61b50dc 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -659,7 +659,7 @@
var outputs []*LintInfo
var dirs []string
ctx.VisitAllModuleProxies(func(m android.ModuleProxy) {
- commonInfo, _ := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoKey)
+ commonInfo, _ := android.OtherModuleProvider(ctx, m, android.CommonModuleInfoProvider)
if ctx.Config().KatiEnabled() && !commonInfo.ExportedToMake {
return
}
diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go
index ab4f8f8..b2d6ca1 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -277,7 +277,7 @@
var compatConfigMetadata android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
if c, ok := android.OtherModuleProvider(ctx, module, PlatformCompatConfigMetadataInfoProvider); ok {
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 0fee529..00ba8b2 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1337,10 +1337,10 @@
func CheckMinSdkVersion(ctx android.ModuleContext, module *Library) {
android.CheckMinSdkVersion(ctx, module.MinSdkVersion(ctx), func(c android.BaseModuleContext, do android.PayloadDepsCallback) {
- ctx.WalkDeps(func(child android.Module, parent android.Module) bool {
+ ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
isExternal := !android.IsDepInSameApex(ctx, module, child)
- if am, ok := child.(android.ApexModule); ok {
- if !do(ctx, parent, am, isExternal) {
+ if am, ok := android.OtherModuleProvider(ctx, child, android.CommonModuleInfoProvider); ok && am.IsApexModule {
+ if !do(ctx, parent, child, isExternal) {
return false
}
}
diff --git a/java/testing.go b/java/testing.go
index 3abbb84..d7878d6 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -424,7 +424,6 @@
"kotlin-stdlib-jdk8",
"kotlin-annotations",
"stub-annotations",
-
"aconfig-annotations-lib",
"aconfig_storage_stub",
"unsupportedappusage",
diff --git a/linkerconfig/linkerconfig.go b/linkerconfig/linkerconfig.go
index 43fe8aa..d117c52 100644
--- a/linkerconfig/linkerconfig.go
+++ b/linkerconfig/linkerconfig.go
@@ -127,7 +127,7 @@
for _, m := range requireModules {
if _, ok := android.OtherModuleProvider(ctx, m, cc.CcInfoProvider); ok {
if android.OtherModuleProviderOrDefault(ctx, m, cc.LinkableInfoProvider).HasStubsVariants &&
- !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoKey).Host {
+ !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoProvider).Host {
name := ctx.OtherModuleName(m)
if ccInfo, ok := android.OtherModuleProvider(ctx, m, cc.CcInfoProvider); ok && ccInfo.LinkerInfo != nil && ccInfo.LinkerInfo.ImplementationModuleName != nil {
name = *ccInfo.LinkerInfo.ImplementationModuleName
diff --git a/python/python.go b/python/python.go
index f8f4165..10c11ad 100644
--- a/python/python.go
+++ b/python/python.go
@@ -400,8 +400,7 @@
// generate the zipfile of all source and data files
p.srcsZip = p.createSrcsZip(ctx, pkgPath)
- // TODO(b/388344853): precompilation temporarily disabled for python3.13 upgrade
- p.precompiledSrcsZip = p.srcsZip //p.precompileSrcs(ctx)
+ p.precompiledSrcsZip = p.precompileSrcs(ctx)
android.SetProvider(ctx, PythonLibraryInfoProvider, PythonLibraryInfo{
SrcsPathMappings: p.getSrcsPathMappings(),
diff --git a/rust/doc.go b/rust/doc.go
index fe20523..cf2f8b3 100644
--- a/rust/doc.go
+++ b/rust/doc.go
@@ -37,14 +37,14 @@
FlagWithArg("-C ", docDir.String()).
FlagWithArg("-D ", docDir.String())
- ctx.VisitAllModules(func(module android.Module) {
- if !module.Enabled(ctx) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoProvider).Enabled {
return
}
- if m, ok := module.(*Module); ok {
- if m.docTimestampFile.Valid() {
- zipCmd.Implicit(m.docTimestampFile.Path())
+ if m, ok := android.OtherModuleProvider(ctx, module, RustInfoProvider); ok {
+ if m.DocTimestampFile.Valid() {
+ zipCmd.Implicit(m.DocTimestampFile.Path())
}
}
})
diff --git a/rust/rust.go b/rust/rust.go
index d8a0444..5f3d7a9 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -61,6 +61,7 @@
SnapshotInfo *cc.SnapshotInfo
SourceProviderInfo *SourceProviderInfo
XrefRustFiles android.Paths
+ DocTimestampFile android.OptionalPath
}
var RustInfoProvider = blueprint.NewProvider[*RustInfo]()
@@ -1173,6 +1174,7 @@
RustSubName: mod.Properties.RustSubName,
TransitiveAndroidMkSharedLibs: mod.transitiveAndroidMkSharedLibs,
XrefRustFiles: mod.XrefRustFiles(),
+ DocTimestampFile: mod.docTimestampFile,
}
if mod.compiler != nil {
rustInfo.CompilerInfo = &CompilerInfo{
@@ -1478,7 +1480,7 @@
rustInfo, hasRustInfo := android.OtherModuleProvider(ctx, dep, RustInfoProvider)
ccInfo, _ := android.OtherModuleProvider(ctx, dep, cc.CcInfoProvider)
linkableInfo, hasLinkableInfo := android.OtherModuleProvider(ctx, dep, cc.LinkableInfoProvider)
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
if hasRustInfo && !linkableInfo.Static && !linkableInfo.Shared {
//Handle Rust Modules
makeLibName := rustMakeLibName(rustInfo, linkableInfo, &commonInfo, depName+rustInfo.RustSubName)
diff --git a/rust/test.go b/rust/test.go
index 9833ffd..9b755b4 100644
--- a/rust/test.go
+++ b/rust/test.go
@@ -165,7 +165,7 @@
if linkableDep.OutputFile.Valid() {
// Copy the output in "lib[64]" so that it's compatible with
// the default rpath values.
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
libDir := "lib"
if commonInfo.Target.Arch.ArchType.Multilib == "lib64" {
libDir = "lib64"
diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py
index 74befd5..a0d2546 100644
--- a/scripts/gen_build_prop.py
+++ b/scripts/gen_build_prop.py
@@ -113,6 +113,7 @@
print("####################################")
config = args.config
+ build_flags = config["BuildFlags"]
partition = args.partition
if partition == "system":
@@ -164,6 +165,7 @@
print(f"ro.{partition}.build.version.release={config['Platform_version_last_stable']}")
print(f"ro.{partition}.build.version.release_or_codename={config['Platform_version_name']}")
print(f"ro.{partition}.build.version.sdk={config['Platform_sdk_version']}")
+ print(f"ro.{partition}.build.version.sdk_minor={build_flags['RELEASE_PLATFORM_SDK_MINOR_VERSION']}")
def generate_build_info(args):
print()
@@ -196,6 +198,7 @@
print(f"ro.build.display.id?={config['BuildDesc']}")
print(f"ro.build.version.incremental={config['BuildNumber']}")
print(f"ro.build.version.sdk={config['Platform_sdk_version']}")
+ print(f"ro.build.version.sdk_minor={build_flags['RELEASE_PLATFORM_SDK_MINOR_VERSION']}")
print(f"ro.build.version.preview_sdk={config['Platform_preview_sdk_version']}")
print(f"ro.build.version.preview_sdk_fingerprint={config['PlatformPreviewSdkFingerprint']}")
print(f"ro.build.version.codename={config['Platform_sdk_codename']}")
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index d00c056..894b17f 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -510,7 +510,7 @@
// so that it's compatible with the default rpath values.
var relPath string
linkableInfo := android.OtherModuleProviderOrDefault(ctx, dep, cc.LinkableInfoProvider)
- commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoKey)
+ commonInfo := android.OtherModuleProviderOrDefault(ctx, dep, android.CommonModuleInfoProvider)
if commonInfo.Target.Arch.ArchType.Multilib == "lib64" {
relPath = filepath.Join("lib64", linkableInfo.OutputFile.Path().Base())