Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" am: eaa432d470 am: fb57372edb

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682094

Change-Id: Ic125330d65870ec4572c0bdbe238c9e65a612fc8
This commit is contained in:
Paul Duffin 2021-04-21 18:02:52 +00:00 committed by Automerger Merge Worker
commit 3fb47c846b
1 changed files with 18 additions and 10 deletions

View File

@ -156,16 +156,24 @@ func (h *hiddenAPI) initHiddenAPI(ctx android.BaseModuleContext, configurationNa
// A source module that has been replaced by a prebuilt can never be the primary module. // A source module that has been replaced by a prebuilt can never be the primary module.
if module.IsReplacedByPrebuilt() { if module.IsReplacedByPrebuilt() {
ctx.VisitDirectDepsWithTag(android.PrebuiltDepTag, func(prebuilt android.Module) { if ctx.HasProvider(android.ApexInfoProvider) {
if h, ok := prebuilt.(hiddenAPIIntf); ok && h.bootDexJar() != nil { // The source module is in an APEX but the prebuilt module on which it depends is not in an
primary = false // APEX and so is not the one that will actually be used for hidden API processing. That
} else { // means it is not possible to check to see if it is a suitable replacement so just assume
ctx.ModuleErrorf( // that it is.
"hiddenapi has determined that the source module %q should be ignored as it has been"+ primary = false
" replaced by the prebuilt module %q but unfortunately it does not provide a"+ } else {
" suitable boot dex jar", ctx.ModuleName(), ctx.OtherModuleName(prebuilt)) ctx.VisitDirectDepsWithTag(android.PrebuiltDepTag, func(prebuilt android.Module) {
} if h, ok := prebuilt.(hiddenAPIIntf); ok && h.bootDexJar() != nil {
}) primary = false
} else {
ctx.ModuleErrorf(
"hiddenapi has determined that the source module %q should be ignored as it has been"+
" replaced by the prebuilt module %q but unfortunately it does not provide a"+
" suitable boot dex jar", ctx.ModuleName(), ctx.OtherModuleName(prebuilt))
}
})
}
} }
} }
h.primary = primary h.primary = primary