diff --git a/java/sdk_library.go b/java/sdk_library.go index f72c6086f..78e31023f 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -1876,6 +1876,14 @@ func (module *SdkLibrary) createApiLibrary(mctx android.DefaultableHookContext, props.Full_api_surface_stub = proptools.StringPtr(apiScope.kind.DefaultJavaLibraryName() + "_full.from-text") } + // java_sdk_library modules that set sdk_version as none does not depend on other api + // domains. Therefore, java_api_library created from such modules should not depend on + // full_api_surface_stubs but create and compile stubs by the java_api_library module + // itself. + if module.SdkVersion(mctx).Kind == android.SdkNone { + props.Full_api_surface_stub = nil + } + props.System_modules = module.deviceProperties.System_modules mctx.CreateModule(ApiLibraryFactory, &props)