From 8f2c5c0ac9ed7cb1910d206766e03138a8386cc1 Mon Sep 17 00:00:00 2001 From: Yu Liu Date: Fri, 6 Dec 2024 00:40:39 +0000 Subject: Convert buildApexDependencyInfo to use ModuleProxy. Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: I7527d331b31a3a97587ca76105e9facb99624bde --- apex/builder.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'apex/builder.go') 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 } } -- cgit v1.2.3-59-g8ed1b