Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot
By default SdkMemberTypes are only supported on module_exports module
type. Support for sdk module type has to be explicitly specified.
The java_header_libs, native_shared_libs and stubs_sources are
supported on sdk. The latter is required to provide the stubs source
for an API specified in java_header_libs as they should be kept in
sync.
Bug: 146341462
Test: m nothing
Change-Id: I19b9e60792780a797458d4a9e489506602b13144
diff --git a/sdk/exports.go b/sdk/exports.go
index c882462..d313057 100644
--- a/sdk/exports.go
+++ b/sdk/exports.go
@@ -24,16 +24,13 @@
// module_exports defines the exports of a mainline module. The exports are Soong modules
// which are required by Soong modules that are not part of the mainline module.
func ModuleExportsFactory() android.Module {
- s := newSdkModule()
- s.properties.Module_exports = true
- return s
+ return newSdkModule(true)
}
// module_exports_snapshot is a versioned snapshot of prebuilt versions of all the exports
// of a mainline module.
func ModuleExportsSnapshotsFactory() android.Module {
- s := newSdkModule()
+ s := newSdkModule(true)
s.properties.Snapshot = true
- s.properties.Module_exports = true
return s
}