diff options
| author | 2024-05-02 14:51:41 +0100 | |
|---|---|---|
| committer | 2024-05-03 08:46:45 +0100 | |
| commit | fb5e07d4d2fa7ce2d442290a820ff7b68e28aeb8 (patch) | |
| tree | 32c6f4f49c632db61444b156567385cfbdaa32f9 /api/api.go | |
| parent | ca3da5d19c2bf7529b289b3e1da3ed45a7db657e (diff) | |
Build complete api-versions.xml files for module-lib/system-server
Previously, APIs from updatable modules and information about the SDK
extensions was only included in `api_versions_public` and
`api_versions_system`. This change adds the following two modules:
* `api_versions_module_lib_complete`
* `api_versions_system_server_complete`
It did not change `api_versions_module_lib` or
`api_versions_system_server` because Android Lint requires that they do
not include information about APIs from updatable modules because
otherwise it will report calls within a module as it has no way to
determine whether a call crosses an API boundary or not.
Bug: 336993217
Test: TARGETS=$(for i in public system module-lib module-lib-complete system-server-complete; do U=$(echo $i | sed "s|-|_|g"); echo "out/target/common/obj/PACKAGING/api_versions_${U}_generated-api-versions.xml"; done)
m $TARGETS; mkdir -p before; cp $TARGETS before
m $TARGETS; mkdir -p after; cp $TARGETS after
meld before after
# Review differences.
Change-Id: Ia542fbdc517fb223a0488f0e3f81b8727cb204e4
Diffstat (limited to 'api/api.go')
| -rw-r--r-- | api/api.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/api/api.go b/api/api.go index b31a26c90789..449fac63f90c 100644 --- a/api/api.go +++ b/api/api.go @@ -386,6 +386,26 @@ func createMergedFrameworkModuleLibStubs(ctx android.LoadHookContext, modules [] ctx.CreateModule(java.LibraryFactory, &props) } +func createMergedFrameworkSystemServerExportableStubs(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string) { + // The user of this module compiles against the "core" SDK and against non-updatable bootclasspathModules, + // so remove to avoid dupes. + bootclasspathModules := removeAll(bootclasspath, core_libraries_modules) + bootclasspathModules = removeAll(bootclasspath, non_updatable_modules) + modules := append( + // Include all the module-lib APIs from the bootclasspath libraries. + transformArray(bootclasspathModules, "", ".stubs.exportable.module_lib"), + // Then add all the system-server APIs from the service-* libraries. + transformArray(system_server_classpath, "", ".stubs.exportable.system_server")..., + ) + props := libraryProps{} + props.Name = proptools.StringPtr("framework-updatable-stubs-system_server_api-exportable") + props.Static_libs = modules + props.Sdk_version = proptools.StringPtr("system_server_current") + props.Visibility = []string{"//frameworks/base"} + props.Is_stubs_module = proptools.BoolPtr(true) + ctx.CreateModule(java.LibraryFactory, &props) +} + func createPublicStubsSourceFilegroup(ctx android.LoadHookContext, modules []string) { props := fgProps{} props.Name = proptools.StringPtr("all-modules-public-stubs-source") @@ -531,6 +551,7 @@ func (a *CombinedApis) createInternalModules(ctx android.LoadHookContext) { createMergedSystemExportableStubs(ctx, bootclasspath) createMergedTestExportableStubsForNonUpdatableModules(ctx) createMergedFrameworkModuleLibExportableStubs(ctx, bootclasspath) + createMergedFrameworkSystemServerExportableStubs(ctx, bootclasspath, system_server_classpath) createMergedAnnotationsFilegroups(ctx, bootclasspath, system_server_classpath) |