summaryrefslogtreecommitdiff
path: root/apex/builder.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-12-06 00:40:39 +0000
committer Yu Liu <yudiliu@google.com> 2024-12-06 00:41:51 +0000
commit8f2c5c0ac9ed7cb1910d206766e03138a8386cc1 (patch)
treeec846f6e5149c3464c15e98dc78f7321d29c5f1f /apex/builder.go
parentb1bfa9d6bd1a37f6102c44240f6a2b56fa2d0c02 (diff)
Convert buildApexDependencyInfo to use ModuleProxy.
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7527d331b31a3a97587ca76105e9facb99624bde
Diffstat (limited to 'apex/builder.go')
-rw-r--r--apex/builder.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/apex/builder.go b/apex/builder.go
index e5ae10622..6204caa4c 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1049,7 +1049,7 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
}
depInfos := android.DepNameToDepInfoMap{}
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDepsProxy(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.
@@ -1058,7 +1058,7 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
// Skip dependencies that are only available to APEXes; they are developed with updatability
// in mind and don't need manual approval.
- if to.(android.ApexModule).NotAvailableForPlatform() {
+ if android.OtherModuleProviderOrDefault(ctx, to, android.CommonModuleInfoKey).NotAvailableForPlatform {
return !externalDep
}
@@ -1076,16 +1076,8 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
depInfos[to.Name()] = info
} else {
toMinSdkVersion := "(no version)"
- if m, ok := to.(interface {
- MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel
- }); ok {
- if v := m.MinSdkVersion(ctx); !v.IsNone() {
- toMinSdkVersion = v.String()
- }
- } else if m, ok := to.(interface{ MinSdkVersion() string }); ok {
- // TODO(b/175678607) eliminate the use of MinSdkVersion returning
- // string
- if v := m.MinSdkVersion(); v != "" {
+ if info, ok := android.OtherModuleProvider(ctx, to, android.CommonModuleInfoKey); ok {
+ if v := info.MinSdkVersion; v != "" {
toMinSdkVersion = v
}
}