Make bootclasspath_fragments always perform hidden API processing
Previously, bootclasspath_fragment modules would only perform hidden API processing if they provided some stub libraries and fragments. That was needed because the bootclasspath_fragment modules were added before Soong supported hidden API processing on all the different modules and before they all provided the necessary information that hidden API processing required. This change stops hidden API being conditional as it is no longer required as it has been enabled on all existing bootclasspath_fragment modules. Bug: 179354495 Test: m nothing Change-Id: I0cbf11986adff1f2f967b96f86e6bfe0e9b8b1ef
This commit is contained in:
@@ -20,7 +20,6 @@ import (
|
||||
|
||||
"android/soong/android"
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/proptools"
|
||||
)
|
||||
|
||||
// Contains support for processing hiddenAPI in a modular fashion.
|
||||
@@ -712,42 +711,6 @@ func newHiddenAPIFlagInput() HiddenAPIFlagInput {
|
||||
return input
|
||||
}
|
||||
|
||||
// canPerformHiddenAPIProcessing determines whether hidden API processing should be performed.
|
||||
//
|
||||
// A temporary workaround to avoid existing bootclasspath_fragments that do not provide the
|
||||
// appropriate information needed for hidden API processing breaking the build.
|
||||
// TODO(b/179354495): Remove this workaround.
|
||||
func (i *HiddenAPIFlagInput) canPerformHiddenAPIProcessing(ctx android.ModuleContext, properties bootclasspathFragmentProperties) bool {
|
||||
// Performing hidden API processing without stubs is not supported and it is unlikely to ever be
|
||||
// required as the whole point of adding something to the bootclasspath fragment is to add it to
|
||||
// the bootclasspath in order to be used by something else in the system. Without any stubs it
|
||||
// cannot do that.
|
||||
if len(i.StubDexJarsByScope) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
// Hidden API processing is always enabled in tests.
|
||||
if ctx.Config().TestProductVariables != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
// A module that has fragments should have access to the information it needs in order to perform
|
||||
// hidden API processing.
|
||||
if len(properties.Fragments) != 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
// The art bootclasspath fragment does not depend on any other fragments but already supports
|
||||
// hidden API processing.
|
||||
imageName := proptools.String(properties.Image_name)
|
||||
if imageName == "art" {
|
||||
return true
|
||||
}
|
||||
|
||||
// Disable it for everything else.
|
||||
return false
|
||||
}
|
||||
|
||||
// gatherStubLibInfo gathers information from the stub libs needed by hidden API processing from the
|
||||
// dependencies added in hiddenAPIAddStubLibDependencies.
|
||||
//
|
||||
|
Reference in New Issue
Block a user