Modify dist artifact dependency to respect the RELEASE_HIDDEN_API_EXPORTABLE_STUBS build flag

Currently, the "exportable" stubs and the api files are copied to the
dist directory during SDK builds regardless of the value of the
RELEASE_HIDDEN_API_EXPORTABLE_STUBS build flag. This change modifies
such behavior that the "exportable" artifacts are copied to the dist
directory only when the RELEASE_HIDDEN_API_EXPORTABLE_STUBS flag value
is set to true.

Test: lunch aosp_arm-trunk_staging-eng && m sdk dist and inspect ninja graph to verify that the "everything" artifacts are copied to the dist directory
Bug: 330417789
Change-Id: I3b83375610eb172d7b9da7ea831a74cd427b696c
diff --git a/java/sdk_library_test.go b/java/sdk_library_test.go
index 93ef408..b622f98 100644
--- a/java/sdk_library_test.go
+++ b/java/sdk_library_test.go
@@ -1393,6 +1393,11 @@
 			"sdklib_group_foo",
 			"sdklib_owner_foo",
 			"foo"),
+		android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
+			variables.BuildFlags = map[string]string{
+				"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
+			}
+		}),
 	).RunTestWithBp(t, `
 		java_sdk_library {
 			name: "sdklib_no_group",