Ignore license and similar dependencies of prebuilt_apex/apex_set

Previously, when determining which dependencies, direct or transitive,
of a prebuilt_apex/apex_set required APEX variants the code assumed
that all dependencies implemented ApexModule. While that is true for
the modules that can be explicitly mentioned in the exported...
properties it is not true for all of them. e.g. A
prebuilt_apex/apex_set can depend on license modules which do not
implement ApexModule.

This change simply ignores any module that does not implement
ApexModule.

Bug: 179354495
Test: m nothing
Change-Id: Iead6f9d1085d169335b88ceadcce2d8cc042254d
This commit is contained in:
Paul Duffin 2021-06-29 18:38:38 +01:00
parent fb8f07bc0e
commit fee8cf36e3
1 changed files with 6 additions and 0 deletions

View File

@ -375,6 +375,12 @@ func (p *prebuiltCommon) apexInfoMutator(mctx android.TopDownMutatorContext) {
}
}
// Ignore any modules that do not implement ApexModule as they cannot have an APEX specific
// variant.
if _, ok := child.(android.ApexModule); !ok {
return false
}
// Strip off the prebuilt_ prefix if present before storing content to ensure consistent
// behavior whether there is a corresponding source module present or not.
depName = android.RemoveOptionalPrebuiltPrefix(depName)