From fee8cf36e3f5c3280b470c8829c9f9a9d4594337 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 29 Jun 2021 18:38:38 +0100 Subject: [PATCH] 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 --- apex/prebuilt.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apex/prebuilt.go b/apex/prebuilt.go index 548cf4c89..30fd359b5 100644 --- a/apex/prebuilt.go +++ b/apex/prebuilt.go @@ -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)