summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-12-10 23:39:24 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-12-10 23:39:24 +0000
commitc4179b5f7fc5e6de0ce27d9583ff5edfc93389c0 (patch)
treefc3ce0b4f1f3daeaea8107dfc169f4e95b85b080 /apex/apex.go
parentea96c9fb69fc7c98b7789bf2d18fb398c5223908 (diff)
parentb73c3a6d221523f06d30c15145866056556187d0 (diff)
Merge "Convert checkApexAvailability to use ModuleProxy." into main
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/apex/apex.go b/apex/apex.go
index e22cf9ea6..912780dca 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2694,7 +2694,7 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
return
}
- a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from android.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDepsProxy(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
@@ -2711,17 +2711,8 @@ func (a *apexBundle) checkApexAvailability(ctx android.ModuleContext) {
fromName := ctx.OtherModuleName(from)
toName := ctx.OtherModuleName(to)
- // 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.
- //
- // It is ok to call DepIsInSameApex() directly from within WalkPayloadDeps().
- if am, ok := from.(android.DepIsInSameApex); ok && !am.DepIsInSameApex(ctx, to) {
- // As soon as the dependency graph crosses the APEX boundary, don't go
- // further.
- return false
- }
-
- if to.AvailableFor(apexName) {
+ if android.CheckAvailableForApex(apexName,
+ android.OtherModuleProviderOrDefault(ctx, to, android.ApexInfoProvider).ApexAvailableFor) {
return true
}