Remove more internal fields from ModuleBase.

Bug: 358425833
Test: Manual compare the generated ninja and mk files and CI.
Change-Id: I4edd0dc646ac035594f47cd9044cc4eb5f710e64
This commit is contained in:
Yu Liu
2024-08-15 18:46:17 +00:00
parent 47a91c9f4f
commit d46e5ae670
15 changed files with 66 additions and 61 deletions

View File

@@ -536,13 +536,14 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint
a.AddStrings("LOCAL_SOONG_MODULE_TYPE", ctx.ModuleType(amod)) a.AddStrings("LOCAL_SOONG_MODULE_TYPE", ctx.ModuleType(amod))
// If the install rule was generated by Soong tell Make about it. // If the install rule was generated by Soong tell Make about it.
if len(base.katiInstalls) > 0 { info := OtherModuleProviderOrDefault(ctx, mod, InstallFilesProvider)
if len(info.KatiInstalls) > 0 {
// Assume the primary install file is last since it probably needs to depend on any other // Assume the primary install file is last since it probably needs to depend on any other
// installed files. If that is not the case we can add a method to specify the primary // installed files. If that is not the case we can add a method to specify the primary
// installed file. // installed file.
a.SetPath("LOCAL_SOONG_INSTALLED_MODULE", base.katiInstalls[len(base.katiInstalls)-1].to) a.SetPath("LOCAL_SOONG_INSTALLED_MODULE", info.KatiInstalls[len(info.KatiInstalls)-1].to)
a.SetString("LOCAL_SOONG_INSTALL_PAIRS", base.katiInstalls.BuiltInstalled()) a.SetString("LOCAL_SOONG_INSTALL_PAIRS", info.KatiInstalls.BuiltInstalled())
a.SetPaths("LOCAL_SOONG_INSTALL_SYMLINKS", base.katiSymlinks.InstallPaths().Paths()) a.SetPaths("LOCAL_SOONG_INSTALL_SYMLINKS", info.KatiSymlinks.InstallPaths().Paths())
} else { } else {
// Soong may not have generated the install rule also when `no_full_install: true`. // Soong may not have generated the install rule also when `no_full_install: true`.
// Mark this module as uninstallable in order to prevent Make from creating an // Mark this module as uninstallable in order to prevent Make from creating an
@@ -550,8 +551,8 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod blueprint
a.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", proptools.Bool(base.commonProperties.No_full_install)) a.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", proptools.Bool(base.commonProperties.No_full_install))
} }
if len(base.testData) > 0 { if len(info.TestData) > 0 {
a.AddStrings("LOCAL_TEST_DATA", androidMkDataPaths(base.testData)...) a.AddStrings("LOCAL_TEST_DATA", androidMkDataPaths(info.TestData)...)
} }
if am, ok := mod.(ApexModule); ok { if am, ok := mod.(ApexModule); ok {

View File

@@ -187,8 +187,8 @@ func buildComplianceMetadataProvider(ctx *moduleContext, m *ModuleBase) {
var installed InstallPaths var installed InstallPaths
installed = append(installed, ctx.installFiles...) installed = append(installed, ctx.installFiles...)
installed = append(installed, m.katiInstalls.InstallPaths()...) installed = append(installed, ctx.katiInstalls.InstallPaths()...)
installed = append(installed, m.katiSymlinks.InstallPaths()...) installed = append(installed, ctx.katiSymlinks.InstallPaths()...)
installed = append(installed, m.katiInitRcInstalls.InstallPaths()...) installed = append(installed, m.katiInitRcInstalls.InstallPaths()...)
installed = append(installed, m.katiVintfInstalls.InstallPaths()...) installed = append(installed, m.katiVintfInstalls.InstallPaths()...)
complianceMetadataInfo.SetListValue(ComplianceMetadataProp.INSTALLED_FILES, FirstUniqueStrings(installed.Strings())) complianceMetadataInfo.SetListValue(ComplianceMetadataProp.INSTALLED_FILES, FirstUniqueStrings(installed.Strings()))

View File

@@ -92,7 +92,7 @@ func buildLicenseMetadata(ctx *moduleContext, licenseMetadataFile WritablePath)
allDepMetadataArgs = append(allDepMetadataArgs, info.LicenseMetadataPath.String()+depAnnotations) allDepMetadataArgs = append(allDepMetadataArgs, info.LicenseMetadataPath.String()+depAnnotations)
if depInstallFiles := ModuleFilesToInstall(ctx, dep); len(depInstallFiles) > 0 { if depInstallFiles := OtherModuleProviderOrDefault(ctx, dep, InstallFilesProvider).InstallFiles; len(depInstallFiles) > 0 {
allDepOutputFiles = append(allDepOutputFiles, depInstallFiles.Paths()...) allDepOutputFiles = append(allDepOutputFiles, depInstallFiles.Paths()...)
} else if depOutputFiles, err := outputFilesForModule(ctx, dep, ""); err == nil { } else if depOutputFiles, err := outputFilesForModule(ctx, dep, ""); err == nil {
depOutputFiles = PathsIfNonNil(depOutputFiles...) depOutputFiles = PathsIfNonNil(depOutputFiles...)

View File

@@ -279,10 +279,11 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) {
} }
if m.ExportedToMake() { if m.ExportedToMake() {
katiInstalls = append(katiInstalls, m.base().katiInstalls...) info := OtherModuleProviderOrDefault(ctx, m, InstallFilesProvider)
katiInstalls = append(katiInstalls, info.KatiInstalls...)
katiInitRcInstalls = append(katiInitRcInstalls, m.base().katiInitRcInstalls...) katiInitRcInstalls = append(katiInitRcInstalls, m.base().katiInitRcInstalls...)
katiVintfManifestInstalls = append(katiVintfManifestInstalls, m.base().katiVintfInstalls...) katiVintfManifestInstalls = append(katiVintfManifestInstalls, m.base().katiVintfInstalls...)
katiSymlinks = append(katiSymlinks, m.base().katiSymlinks...) katiSymlinks = append(katiSymlinks, info.KatiSymlinks...)
} }
}) })

View File

@@ -112,8 +112,6 @@ type Module interface {
HostRequiredModuleNames() []string HostRequiredModuleNames() []string
TargetRequiredModuleNames() []string TargetRequiredModuleNames() []string
PackagingSpecs() []PackagingSpec
// TransitivePackagingSpecs returns the PackagingSpecs for this module and any transitive // TransitivePackagingSpecs returns the PackagingSpecs for this module and any transitive
// dependencies with dependency tags for which IsInstallDepNeeded() returns true. // dependencies with dependency tags for which IsInstallDepNeeded() returns true.
TransitivePackagingSpecs() []PackagingSpec TransitivePackagingSpecs() []PackagingSpec
@@ -759,14 +757,6 @@ func InitCommonOSAndroidMultiTargetsArchModule(m Module, hod HostOrDeviceSupport
m.base().commonProperties.CreateCommonOSVariant = true m.base().commonProperties.CreateCommonOSVariant = true
} }
func ModuleFilesToInstall(ctx OtherModuleProviderContext, m blueprint.Module) InstallPaths {
var filesToInstall InstallPaths
if info, ok := OtherModuleProvider(ctx, m, InstallFilesProvider); ok {
filesToInstall = info.InstallFiles
}
return filesToInstall
}
// A ModuleBase object contains the properties that are common to all Android // A ModuleBase object contains the properties that are common to all Android
// modules. It should be included as an anonymous field in every module // modules. It should be included as an anonymous field in every module
// struct definition. InitAndroidModule should then be called from the module's // struct definition. InitAndroidModule should then be called from the module's
@@ -840,18 +830,11 @@ type ModuleBase struct {
noAddressSanitizer bool noAddressSanitizer bool
installFilesDepSet *DepSet[InstallPath] installFilesDepSet *DepSet[InstallPath]
checkbuildFiles Paths
packagingSpecs []PackagingSpec
packagingSpecsDepSet *DepSet[PackagingSpec] packagingSpecsDepSet *DepSet[PackagingSpec]
// katiInstalls tracks the install rules that were created by Soong but are being exported
// to Make to convert to ninja rules so that Make can add additional dependencies.
katiInstalls katiInstalls
// katiInitRcInstalls and katiVintfInstalls track the install rules created by Soong that are // katiInitRcInstalls and katiVintfInstalls track the install rules created by Soong that are
// allowed to have duplicates across modules and variants. // allowed to have duplicates across modules and variants.
katiInitRcInstalls katiInstalls katiInitRcInstalls katiInstalls
katiVintfInstalls katiInstalls katiVintfInstalls katiInstalls
katiSymlinks katiInstalls
testData []DataPath
// The files to copy to the dist as explicitly specified in the .bp file. // The files to copy to the dist as explicitly specified in the .bp file.
distFiles TaggedDistFiles distFiles TaggedDistFiles
@@ -1482,10 +1465,6 @@ func isInstallDepNeeded(dep Module, tag blueprint.DependencyTag) bool {
return IsInstallDepNeededTag(tag) return IsInstallDepNeededTag(tag)
} }
func (m *ModuleBase) PackagingSpecs() []PackagingSpec {
return m.packagingSpecs
}
func (m *ModuleBase) TransitivePackagingSpecs() []PackagingSpec { func (m *ModuleBase) TransitivePackagingSpecs() []PackagingSpec {
return m.packagingSpecsDepSet.ToList() return m.packagingSpecsDepSet.ToList()
} }
@@ -1622,17 +1601,21 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) {
var allCheckbuildFiles Paths var allCheckbuildFiles Paths
ctx.VisitAllModuleVariants(func(module Module) { ctx.VisitAllModuleVariants(func(module Module) {
a := module.base() a := module.base()
var checkBuilds Paths
if a == m { if a == m {
allInstalledFiles = append(allInstalledFiles, ctx.installFiles...) allInstalledFiles = append(allInstalledFiles, ctx.installFiles...)
checkBuilds = ctx.checkbuildFiles
} else { } else {
allInstalledFiles = append(allInstalledFiles, ModuleFilesToInstall(ctx, module)...) info := OtherModuleProviderOrDefault(ctx, module, InstallFilesProvider)
allInstalledFiles = append(allInstalledFiles, info.InstallFiles...)
checkBuilds = info.CheckbuildFiles
} }
// A module's -checkbuild phony targets should // A module's -checkbuild phony targets should
// not be created if the module is not exported to make. // not be created if the module is not exported to make.
// Those could depend on the build target and fail to compile // Those could depend on the build target and fail to compile
// for the current build target. // for the current build target.
if !ctx.Config().KatiEnabled() || !shouldSkipAndroidMkProcessing(ctx, a) { if !ctx.Config().KatiEnabled() || !shouldSkipAndroidMkProcessing(ctx, a) {
allCheckbuildFiles = append(allCheckbuildFiles, a.checkbuildFiles...) allCheckbuildFiles = append(allCheckbuildFiles, checkBuilds...)
} }
}) })
@@ -1770,7 +1753,14 @@ func (m *ModuleBase) archModuleContextFactory(ctx archModuleContextFactoryContex
} }
type InstallFilesInfo struct { type InstallFilesInfo struct {
InstallFiles InstallPaths InstallFiles InstallPaths
CheckbuildFiles Paths
PackagingSpecs []PackagingSpec
// katiInstalls tracks the install rules that were created by Soong but are being exported
// to Make to convert to ninja rules so that Make can add additional dependencies.
KatiInstalls katiInstalls
KatiSymlinks katiInstalls
TestData []DataPath
} }
var InstallFilesProvider = blueprint.NewProvider[InstallFilesInfo]() var InstallFilesProvider = blueprint.NewProvider[InstallFilesInfo]()
@@ -1956,14 +1946,13 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
return return
} }
m.checkbuildFiles = append(m.checkbuildFiles, ctx.checkbuildFiles...)
m.packagingSpecs = append(m.packagingSpecs, ctx.packagingSpecs...)
m.katiInstalls = append(m.katiInstalls, ctx.katiInstalls...)
m.katiSymlinks = append(m.katiSymlinks, ctx.katiSymlinks...)
m.testData = append(m.testData, ctx.testData...)
SetProvider(ctx, InstallFilesProvider, InstallFilesInfo{ SetProvider(ctx, InstallFilesProvider, InstallFilesInfo{
InstallFiles: ctx.installFiles, InstallFiles: ctx.installFiles,
CheckbuildFiles: ctx.checkbuildFiles,
PackagingSpecs: ctx.packagingSpecs,
KatiInstalls: ctx.katiInstalls,
KatiSymlinks: ctx.katiSymlinks,
TestData: ctx.testData,
}) })
} else if ctx.Config().AllowMissingDependencies() { } else if ctx.Config().AllowMissingDependencies() {
// If the module is not enabled it will not create any build rules, nothing will call // If the module is not enabled it will not create any build rules, nothing will call
@@ -1981,14 +1970,14 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
} }
m.installFilesDepSet = NewDepSet[InstallPath](TOPOLOGICAL, ctx.installFiles, dependencyInstallFiles) m.installFilesDepSet = NewDepSet[InstallPath](TOPOLOGICAL, ctx.installFiles, dependencyInstallFiles)
m.packagingSpecsDepSet = NewDepSet[PackagingSpec](TOPOLOGICAL, m.packagingSpecs, dependencyPackagingSpecs) m.packagingSpecsDepSet = NewDepSet[PackagingSpec](TOPOLOGICAL, ctx.packagingSpecs, dependencyPackagingSpecs)
buildLicenseMetadata(ctx, m.licenseMetadataFile) buildLicenseMetadata(ctx, m.licenseMetadataFile)
if m.moduleInfoJSON != nil { if m.moduleInfoJSON != nil {
var installed InstallPaths var installed InstallPaths
installed = append(installed, m.katiInstalls.InstallPaths()...) installed = append(installed, ctx.katiInstalls.InstallPaths()...)
installed = append(installed, m.katiSymlinks.InstallPaths()...) installed = append(installed, ctx.katiSymlinks.InstallPaths()...)
installed = append(installed, m.katiInitRcInstalls.InstallPaths()...) installed = append(installed, m.katiInitRcInstalls.InstallPaths()...)
installed = append(installed, m.katiVintfInstalls.InstallPaths()...) installed = append(installed, m.katiVintfInstalls.InstallPaths()...)
installedStrings := installed.Strings() installedStrings := installed.Strings()
@@ -2001,7 +1990,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
} }
var data []string var data []string
for _, d := range m.testData { for _, d := range ctx.testData {
data = append(data, d.ToRelativeInstallPath()) data = append(data, d.ToRelativeInstallPath())
} }
@@ -2681,7 +2670,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) {
ctx.VisitAllModules(func(module Module) { ctx.VisitAllModules(func(module Module) {
if module.Enabled(ctx) { if module.Enabled(ctx) {
key := osAndCross{os: module.Target().Os, hostCross: module.Target().HostCross} key := osAndCross{os: module.Target().Os, hostCross: module.Target().HostCross}
osDeps[key] = append(osDeps[key], module.base().checkbuildFiles...) osDeps[key] = append(osDeps[key], OtherModuleProviderOrDefault(ctx, module, InstallFilesProvider).CheckbuildFiles...)
} }
}) })

View File

@@ -231,8 +231,8 @@ type moduleContext struct {
module Module module Module
phonies map[string]Paths phonies map[string]Paths
katiInstalls []katiInstall katiInstalls katiInstalls
katiSymlinks []katiInstall katiSymlinks katiInstalls
testData []DataPath testData []DataPath

View File

@@ -32,6 +32,11 @@ func OtherModuleProvider[K any](ctx OtherModuleProviderContext, module blueprint
return value.(K), ok return value.(K), ok
} }
func OtherModuleProviderOrDefault[K any](ctx OtherModuleProviderContext, module blueprint.Module, provider blueprint.ProviderKey[K]) K {
value, _ := OtherModuleProvider(ctx, module, provider)
return value
}
// ModuleProviderContext is a helper interface that is a subset of ModuleContext, BottomUpMutatorContext, or // ModuleProviderContext is a helper interface that is a subset of ModuleContext, BottomUpMutatorContext, or
// TopDownMutatorContext for use in ModuleProvider. // TopDownMutatorContext for use in ModuleProvider.
type ModuleProviderContext interface { type ModuleProviderContext interface {

View File

@@ -47,7 +47,8 @@ func (t *testSuiteFiles) GenerateBuildActions(ctx SingletonContext) {
files[testSuite] = make(map[string]InstallPaths) files[testSuite] = make(map[string]InstallPaths)
} }
name := ctx.ModuleName(m) name := ctx.ModuleName(m)
files[testSuite][name] = append(files[testSuite][name], ModuleFilesToInstall(ctx, tsm)...) files[testSuite][name] = append(files[testSuite][name],
OtherModuleProviderOrDefault(ctx, tsm, InstallFilesProvider).InstallFiles...)
} }
} }
}) })

View File

@@ -476,7 +476,8 @@ func (m *CmakeSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
var prebuiltsList android.Paths var prebuiltsList android.Paths
ctx.VisitDirectDepsWithTag(cmakeSnapshotPrebuiltTag, func(dep android.Module) { ctx.VisitDirectDepsWithTag(cmakeSnapshotPrebuiltTag, func(dep android.Module) {
for _, file := range android.ModuleFilesToInstall(ctx, dep) { for _, file := range android.OtherModuleProviderOrDefault(
ctx, dep, android.InstallFilesProvider).InstallFiles {
prebuiltsList = append(prebuiltsList, file) prebuiltsList = append(prebuiltsList, file)
} }
}) })

View File

@@ -39,8 +39,9 @@ func IsStubTarget(m *Module) bool {
} }
// Get target file name to be installed from this module // Get target file name to be installed from this module
func getInstalledFileName(m *Module) string { func getInstalledFileName(ctx android.SingletonContext, m *Module) string {
for _, ps := range m.PackagingSpecs() { for _, ps := range android.OtherModuleProviderOrDefault(
ctx, m.Module(), android.InstallFilesProvider).PackagingSpecs {
if name := ps.FileName(); name != "" { if name := ps.FileName(); name != "" {
return name return name
} }
@@ -53,7 +54,7 @@ func (s *stubLibraries) GenerateBuildActions(ctx android.SingletonContext) {
ctx.VisitAllModules(func(module android.Module) { ctx.VisitAllModules(func(module android.Module) {
if m, ok := module.(*Module); ok { if m, ok := module.(*Module); ok {
if IsStubTarget(m) { if IsStubTarget(m) {
if name := getInstalledFileName(m); name != "" { if name := getInstalledFileName(ctx, m); name != "" {
s.stubLibraryMap[name] = true s.stubLibraryMap[name] = true
if m.InVendor() { if m.InVendor() {
s.stubVendorLibraryMap[name] = true s.stubVendorLibraryMap[name] = true

View File

@@ -61,7 +61,8 @@ func (s *systemImage) buildLinkerConfigFile(ctx android.ModuleContext, root andr
deps := s.gatherFilteredPackagingSpecs(ctx) deps := s.gatherFilteredPackagingSpecs(ctx)
ctx.WalkDeps(func(child, parent android.Module) bool { ctx.WalkDeps(func(child, parent android.Module) bool {
for _, ps := range child.PackagingSpecs() { for _, ps := range android.OtherModuleProviderOrDefault(
ctx, child, android.InstallFilesProvider).PackagingSpecs {
if _, ok := deps[ps.RelPathInPackage()]; ok { if _, ok := deps[ps.RelPathInPackage()]; ok {
modulesInPackageByModule[child] = true modulesInPackageByModule[child] = true
modulesInPackageByName[child.Name()] = true modulesInPackageByName[child.Name()] = true

View File

@@ -1109,7 +1109,7 @@ func collectJniDeps(ctx android.ModuleContext,
coverageFile: dep.CoverageOutputFile(), coverageFile: dep.CoverageOutputFile(),
unstrippedFile: dep.UnstrippedOutputFile(), unstrippedFile: dep.UnstrippedOutputFile(),
partition: dep.Partition(), partition: dep.Partition(),
installPaths: android.ModuleFilesToInstall(ctx, dep), installPaths: android.OtherModuleProviderOrDefault(ctx, dep, android.InstallFilesProvider).InstallFiles,
}) })
} else if ctx.Config().AllowMissingDependencies() { } else if ctx.Config().AllowMissingDependencies() {
ctx.AddMissingDependencies([]string{otherName}) ctx.AddMissingDependencies([]string{otherName})

View File

@@ -152,7 +152,8 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
var runtimeJniModuleNames map[string]bool var runtimeJniModuleNames map[string]bool
if utils := ctx.GetDirectDepsWithTag(ravenwoodUtilsTag)[0]; utils != nil { if utils := ctx.GetDirectDepsWithTag(ravenwoodUtilsTag)[0]; utils != nil {
for _, installFile := range android.ModuleFilesToInstall(ctx, utils) { for _, installFile := range android.OtherModuleProviderOrDefault(
ctx, utils, android.InstallFilesProvider).InstallFiles {
installDeps = append(installDeps, installFile) installDeps = append(installDeps, installFile)
} }
jniDeps, ok := android.OtherModuleProvider(ctx, utils, ravenwoodLibgroupJniDepProvider) jniDeps, ok := android.OtherModuleProvider(ctx, utils, ravenwoodLibgroupJniDepProvider)
@@ -162,7 +163,8 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
} }
if runtime := ctx.GetDirectDepsWithTag(ravenwoodRuntimeTag)[0]; runtime != nil { if runtime := ctx.GetDirectDepsWithTag(ravenwoodRuntimeTag)[0]; runtime != nil {
for _, installFile := range android.ModuleFilesToInstall(ctx, runtime) { for _, installFile := range android.OtherModuleProviderOrDefault(
ctx, runtime, android.InstallFilesProvider).InstallFiles {
installDeps = append(installDeps, installFile) installDeps = append(installDeps, installFile)
} }
jniDeps, ok := android.OtherModuleProvider(ctx, runtime, ravenwoodLibgroupJniDepProvider) jniDeps, ok := android.OtherModuleProvider(ctx, runtime, ravenwoodLibgroupJniDepProvider)
@@ -191,7 +193,8 @@ func (r *ravenwoodTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
resApkInstallPath := installPath.Join(ctx, "ravenwood-res-apks") resApkInstallPath := installPath.Join(ctx, "ravenwood-res-apks")
if resApk := ctx.GetDirectDepsWithTag(ravenwoodTestResourceApkTag); len(resApk) > 0 { if resApk := ctx.GetDirectDepsWithTag(ravenwoodTestResourceApkTag); len(resApk) > 0 {
for _, installFile := range android.ModuleFilesToInstall(ctx, resApk[0]) { for _, installFile := range android.OtherModuleProviderOrDefault(
ctx, resApk[0], android.InstallFilesProvider).InstallFiles {
installResApk := ctx.InstallFile(resApkInstallPath, "ravenwood-res.apk", installFile) installResApk := ctx.InstallFile(resApkInstallPath, "ravenwood-res.apk", installFile)
installDeps = append(installDeps, installResApk) installDeps = append(installDeps, installResApk)
} }

View File

@@ -49,7 +49,8 @@ func TestKernelModulesFilelist(t *testing.T) {
} }
var actual []string var actual []string
for _, ps := range ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module().PackagingSpecs() { for _, ps := range android.OtherModuleProviderOrDefault(
ctx, ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module(), android.InstallFilesProvider).PackagingSpecs {
actual = append(actual, ps.RelPathInPackage()) actual = append(actual, ps.RelPathInPackage())
} }
actual = android.SortedUniqueStrings(actual) actual = android.SortedUniqueStrings(actual)

View File

@@ -105,7 +105,8 @@ func BuildLinkerConfig(ctx android.ModuleContext, builder *android.RuleBuilder,
var provideLibs []string var provideLibs []string
for _, m := range provideModules { for _, m := range provideModules {
if c, ok := m.(*cc.Module); ok && (cc.IsStubTarget(c) || c.HasLlndkStubs()) { if c, ok := m.(*cc.Module); ok && (cc.IsStubTarget(c) || c.HasLlndkStubs()) {
for _, ps := range c.PackagingSpecs() { for _, ps := range android.OtherModuleProviderOrDefault(
ctx, c, android.InstallFilesProvider).PackagingSpecs {
provideLibs = append(provideLibs, ps.FileName()) provideLibs = append(provideLibs, ps.FileName())
} }
} }