From f7bbd2fe40e43f7fda7e08d08eeb9c2a93552ad9 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 5 Dec 2024 13:57:10 -0800 Subject: Split DepIsInSameApex into outgoing and incoming Prepare for calling DepIsInSameApex from the apex transition mutator by splitting all the implementations in two, one that is called on the outgoing module and only takes the depTag, and one that is called on the incoming module and only takes the depTag. apexBundle.depVisitor was passing the child into android.IsDepInSameApex for both the parent and child paramters. The parent field was only used to find the type on which to call DepIsInSameApex, so this effectively used the child's implementation of DepIsInSameApex. That used to be necessary when the parent and child were of different module types, as the parent module type may not have been aware of the rules for the child module type, but is no longer necessary with split outgoing and incoming DepIsInSameApex. Bug: 372543712 Test: all soong tests pass Change-Id: If7c81ec3f7b1ea69d77e9ad7694e238820194e59 --- apex/prebuilt.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apex/prebuilt.go') diff --git a/apex/prebuilt.go b/apex/prebuilt.go index f93eada8b..aaf2cb77d 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -274,12 +274,15 @@ func (p *prebuiltCommon) prebuiltApexContentsDeps(ctx android.BottomUpMutatorCon } // Implements android.DepInInSameApex -func (p *prebuiltCommon) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { - tag := ctx.OtherModuleDependencyTag(dep) +func (p *prebuiltCommon) OutgoingDepIsInSameApex(tag blueprint.DependencyTag) bool { _, ok := tag.(exportedDependencyTag) return ok } +func (p *prebuiltCommon) IncomingDepIsInSameApex(tag blueprint.DependencyTag) bool { + return true +} + // apexInfoMutator marks any modules for which this apex exports a file as requiring an apex // specific variant and checks that they are supported. // -- cgit v1.2.3-59-g8ed1b