Merge "Allow java_sdk_library_import to contribute to hiddenapi processing"

This commit is contained in:
Paul Duffin
2021-03-01 17:04:39 +00:00
committed by Gerrit Code Review
3 changed files with 101 additions and 13 deletions

View File

@@ -1772,6 +1772,8 @@ type SdkLibraryImport struct {
android.ApexModuleBase
android.SdkBase
hiddenAPI
properties sdkLibraryImportProperties
// Map from api scope to the scope specific property structure.
@@ -2046,6 +2048,8 @@ func (module *SdkLibraryImport) GenerateAndroidBuildActions(ctx android.ModuleCo
di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo)
if dexOutputPath := di.PrebuiltExportPath(module.BaseModuleName(), ".dexjar"); dexOutputPath != nil {
module.dexJarFile = dexOutputPath
module.initHiddenAPI(ctx, module.configurationName)
module.hiddenAPIExtractInformation(ctx, dexOutputPath, module.findScopePaths(apiScopePublic).stubsImplPath[0])
} else {
// This should never happen as a variant for a prebuilt_apex is only created if the
// prebuilt_apex has been configured to export the java library dex file.

View File

@@ -240,6 +240,7 @@ func CheckModuleDependencies(t *testing.T, ctx *android.TestContext, name, varia
}
func CheckHiddenAPIRuleInputs(t *testing.T, expected string, hiddenAPIRule android.TestingBuildParams) {
t.Helper()
actual := strings.TrimSpace(strings.Join(android.NormalizePathsForTesting(hiddenAPIRule.Implicits), "\n"))
expected = strings.TrimSpace(expected)
if actual != expected {