Allow java_sdk_library_import to contribute to hiddenapi processing
Invokes hiddenAPIExtractInformation() on the java_sdk_library_import's
dex implementation jar provided by the deapexer (on behalf of
prebuilt_apex) so that hiddenAPI can extract the information it needs,
if anything, from the dex file.
The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.
Usually, it would require a classes implementation jar as well in
order to extract information from UnsupportedAppUsage annotations but
that is not available for a java_sdk_library_import. Fortunately, the
modules that are currently affected by this do not contain any such
annotations. This just uses a public api stubs jar instead.
Bug: 181267622
Test: m nothing
Change-Id: I96275e46f8b7fecba88075319e9f2da5ae315c03
diff --git a/java/sdk_library.go b/java/sdk_library.go
index e0100d4..30d120d 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1772,6 +1772,8 @@
android.ApexModuleBase
android.SdkBase
+ hiddenAPI
+
properties sdkLibraryImportProperties
// Map from api scope to the scope specific property structure.
@@ -2046,6 +2048,8 @@
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.