Add the name of the sdk library to dynamically generated java modules
The name of the sdk library will be used in source vs prebuilt
selection. For soong modules that are not dynamically created from a
java_sdk_library, the value will be nil.
Bug: 308174768
Test: TH
Change-Id: Ic7e9889f00c6184992b663a7124967bb0794d475
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 7807889..1de8972 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1829,7 +1829,7 @@
}
}
- mctx.CreateModule(DroidstubsFactory, &props).(*Droidstubs).CallHookIfAvailable(mctx)
+ mctx.CreateModule(DroidstubsFactory, &props, module.sdkComponentPropertiesForChildLibrary()).(*Droidstubs).CallHookIfAvailable(mctx)
}
func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext, apiScope *apiScope, alternativeFullApiSurfaceStub string) {
@@ -1892,7 +1892,7 @@
props.System_modules = module.deviceProperties.System_modules
props.Enable_validation = proptools.BoolPtr(true)
- mctx.CreateModule(ApiLibraryFactory, &props)
+ mctx.CreateModule(ApiLibraryFactory, &props, module.sdkComponentPropertiesForChildLibrary())
}
func (module *SdkLibrary) createTopLevelStubsLibrary(
@@ -2590,7 +2590,7 @@
// The stubs source is preferred if the java_sdk_library_import is preferred.
props.CopyUserSuppliedPropertiesFromPrebuilt(&module.prebuilt)
- mctx.CreateModule(PrebuiltStubsSourcesFactory, &props)
+ mctx.CreateModule(PrebuiltStubsSourcesFactory, &props, module.sdkComponentPropertiesForChildLibrary())
}
func (module *SdkLibraryImport) createPrebuiltApiContribution(mctx android.DefaultableHookContext, apiScope *apiScope, scopeProperties *sdkLibraryScopeProperties) {
@@ -2609,7 +2609,7 @@
props.Api_file = api_file
props.Visibility = []string{"//visibility:override", "//visibility:public"}
- mctx.CreateModule(ApiContributionImportFactory, &props)
+ mctx.CreateModule(ApiContributionImportFactory, &props, module.sdkComponentPropertiesForChildLibrary())
}
// Add the dependencies on the child module in the component deps mutator so that it