From 3f1ae0b55acd7e727c6227c3ab3e4f34e885e478 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 27 Jul 2022 16:27:42 +0000 Subject: Add hidden API properties to java_sdk_library modules Previously, hidden API properties were only allowed on bootclasspath_fragment and platform_bootclasspath module types. This change allows them to be specified on java_sdk_library modules too. It involves the following changes: 1. Add the properties to the java.Module. 2. Populate and provide a HiddenAPIPropertyInfo struct from java_sdk_library modules. 3. Modify bootclasspath_fragment to merge information gathered from its content libraries as if it was specified on the fragment itself. Bug: 240406019 Test: m nothing packages/modules/common/build/mainline_modules_sdks.sh # Ran the previous command with and without this change to make # sure that this change does not change the sdk snapshot # contents. Change-Id: I64eb71c2039ddc14cf380689d0cec7ec221f5b88 --- java/bootclasspath_fragment.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'java/bootclasspath_fragment.go') diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index 7580352d0..93168070e 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -830,6 +830,8 @@ func (b *BootclasspathFragmentModule) createHiddenAPIFlagInput(ctx android.Modul // Populate with package rules from the properties. input.extractPackageRulesFromProperties(&b.sourceOnlyProperties.HiddenAPIPackageProperties) + input.gatherPropertyInfo(ctx, contents) + // Add the stub dex jars from this module's fragment dependencies. input.DependencyStubDexJarsByScope.addStubDexJarsByModule(dependencyHiddenApiInfo.TransitiveStubDexJarsByScope) -- cgit v1.2.3-59-g8ed1b