platform_bootclasspath: aggregate hidden API flag files from fragments
Aggregates hidden API flag files from the bootclasspath_fragments which
will allow the hidden API flag files in frameworks/base/boot/hiddenapi
to be modularized and moved to the appropriate repo.
Bug: 177892522
Test: verified that the out/soong/hiddenapi/... files are unchanged
by this change
also verified that changes to the fragment provided files do
affect the monolithic files.
Change-Id: Ifce14c9ef24c58c7ab1085475d85b61cfbfefecd
diff --git a/java/boot_image.go b/java/boot_image.go
index 0c47976..78215f0 100644
--- a/java/boot_image.go
+++ b/java/boot_image.go
@@ -84,6 +84,8 @@
//
// The order of this list matters as it is the order that is used in the bootclasspath.
Contents []string
+
+ Hidden_api HiddenAPIFlagFileProperties
}
type BootImageModule struct {
@@ -213,6 +215,9 @@
}
func (b *BootImageModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+ // Perform hidden API processing.
+ b.generateHiddenAPIBuildActions(ctx)
+
// Nothing to do if skipping the dexpreopt of boot image jars.
if SkipDexpreoptBootJars(ctx) {
return
@@ -253,6 +258,15 @@
return imageConfig
}
+// generateHiddenAPIBuildActions generates all the hidden API related build rules.
+func (b *BootImageModule) generateHiddenAPIBuildActions(ctx android.ModuleContext) {
+ // Resolve the properties to paths.
+ flagFileInfo := b.properties.Hidden_api.hiddenAPIFlagFileInfo(ctx)
+
+ // Store the information for use by platform_bootclasspath.
+ ctx.SetProvider(hiddenAPIFlagFileInfoProvider, flagFileInfo)
+}
+
type bootImageMemberType struct {
android.SdkMemberTypeBase
}