From b36fc547c0040de88c3012af5f5cf8c6043b5ec3 Mon Sep 17 00:00:00 2001 From: Jihoon Kang Date: Thu, 22 Feb 2024 19:35:26 +0000 Subject: [PATCH] Introduce product variable PRODUCT_HIDDEN_API_EXPORTABLE_STUBS The new product variable behaves identical to the build flag RELEASE_HIDDEN_API_EXPORTABLE_STUBS: if the variable is set to true, the hiddenapi flags are generated from the "exportable" stubs (i.e. the stubs that does not include READ_WRITE permission or DISABLE state flagged apis) instead of the "everything" stubs (i.e. the stubs that includes all flagged apis regardless of the state of the flags). If the variable is set to false, the stubs are generated from the "everything" stubs. This product variable will be utilized for `sdk_with_runtime_apis` product in the future changes. Test: m nothing Bug: 326310637 Change-Id: I8872d0b0617eb0f25da32611837ad823c77b0df7 --- android/config.go | 3 ++- android/variable.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/android/config.go b/android/config.go index 75471b9cb..84305112a 100644 --- a/android/config.go +++ b/android/config.go @@ -222,7 +222,8 @@ func (c Config) ReleaseNdkAbiMonitored() bool { } func (c Config) ReleaseHiddenApiExportableStubs() bool { - return c.config.productVariables.GetBuildFlagBool("RELEASE_HIDDEN_API_EXPORTABLE_STUBS") + return c.config.productVariables.GetBuildFlagBool("RELEASE_HIDDEN_API_EXPORTABLE_STUBS") || + Bool(c.config.productVariables.HiddenapiExportableStubs) } // A DeviceConfig object represents the configuration for a particular device diff --git a/android/variable.go b/android/variable.go index 252002037..32365067a 100644 --- a/android/variable.go +++ b/android/variable.go @@ -496,6 +496,8 @@ type ProductVariables struct { BuildFromSourceStub *bool `json:",omitempty"` BuildIgnoreApexContributionContents []string `json:",omitempty"` + + HiddenapiExportableStubs *bool `json:",omitempty"` } type PartitionQualifiedVariablesType struct {