diff --git a/android/config.go b/android/config.go index 6dc8e1603..b715de0f9 100644 --- a/android/config.go +++ b/android/config.go @@ -213,7 +213,7 @@ func (c Config) ReleaseDefaultModuleBuildFromSource() bool { // Enables flagged apis annotated with READ_WRITE aconfig flags to be included in the stubs // and hiddenapi flags so that they are accessible at runtime func (c Config) ReleaseExportRuntimeApis() bool { - return c.config.productVariables.GetBuildFlagBool("RELEASE_EXPORT_RUNTIME_APIS") + return Bool(c.config.productVariables.ExportRuntimeApis) } // Enables ABI monitoring of NDK libraries diff --git a/android/variable.go b/android/variable.go index 32365067a..be3c80d8e 100644 --- a/android/variable.go +++ b/android/variable.go @@ -498,6 +498,8 @@ type ProductVariables struct { BuildIgnoreApexContributionContents []string `json:",omitempty"` HiddenapiExportableStubs *bool `json:",omitempty"` + + ExportRuntimeApis *bool `json:",omitempty"` } type PartitionQualifiedVariablesType struct { diff --git a/java/droidstubs_test.go b/java/droidstubs_test.go index caa834535..e5ffd2847 100644 --- a/java/droidstubs_test.go +++ b/java/droidstubs_test.go @@ -22,6 +22,8 @@ import ( "testing" "android/soong/android" + + "github.com/google/blueprint/proptools" ) func TestDroidstubs(t *testing.T) { @@ -419,8 +421,8 @@ func TestReleaseExportRuntimeApis(t *testing.T) { android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { variables.BuildFlags = map[string]string{ "RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true", - "RELEASE_EXPORT_RUNTIME_APIS": "true", } + variables.ExportRuntimeApis = proptools.BoolPtr(true) }), android.FixtureMergeMockFs(map[string][]byte{ "a/A.java": nil,