summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Nikita Ioffe <ioffe@google.com> 2022-11-15 11:26:53 +0000
committer Nikita Ioffe <ioffe@google.com> 2022-11-16 12:48:35 +0000
commitd3f0a6fdb8da0279486bea61f03470ed35466f9f (patch)
treeebd75e48a7dd46fa8cbfd89f4056ebaad102efe3 /api/api.go
parent3c318cc21aee689f9e70ad4f6b9af00eab45cb8f (diff)
Add framework-virtualization to combined_apis
Since framework-virtualization is part of a non-updatable APEX module, it should still be allowed to compile against unstable APIs. However, the current setup of all-framework-module-impl prevents that, since the all-framework-module-lib target compiles against module_sdk. This change works around this by introducing the updatable-framework-module-impl target which builds against module_current SDK, and includes all updatable modules. The non-updatable modules are then statically linked into the all-framework-module-impl target, which builds against hidden APIs. Bug: 243512044 Test: builds Change-Id: I253aa8dcd7c9b109e023a44128ce08ec8f2b4d33
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go39
1 files changed, 33 insertions, 6 deletions
diff --git a/api/api.go b/api/api.go
index 6a6c493e041a..ba0fdc18d23e 100644
--- a/api/api.go
+++ b/api/api.go
@@ -27,8 +27,16 @@ import (
const art = "art.module.public.api"
const conscrypt = "conscrypt.module.public.api"
const i18n = "i18n.module.public.api"
+const virtualization = "framework-virtualization"
var core_libraries_modules = []string{art, conscrypt, i18n}
+// List of modules that are not yet updatable, and hence they can still compile
+// against hidden APIs. These modules are filtered out when building the
+// updatable-framework-module-impl (because updatable-framework-module-impl is
+// built against module_current SDK). Instead they are directly statically
+// linked into the all-framework-module-lib, which is building against hidden
+// APIs.
+var non_updatable_modules = []string{virtualization}
// The intention behind this soong plugin is to generate a number of "merged"
// API-related modules that would otherwise require a large amount of very
@@ -249,12 +257,31 @@ func createMergedSystemStubs(ctx android.LoadHookContext, modules []string) {
func createMergedFrameworkImpl(ctx android.LoadHookContext, modules []string) {
// This module is for the "framework-all" module, which should not include the core libraries.
modules = removeAll(modules, core_libraries_modules)
- props := libraryProps{}
- props.Name = proptools.StringPtr("all-framework-module-impl")
- props.Static_libs = transformArray(modules, "", ".impl")
- props.Sdk_version = proptools.StringPtr("module_current")
- props.Visibility = []string{"//frameworks/base"}
- ctx.CreateModule(java.LibraryFactory, &props)
+ // Remove the modules that belong to non-updatable APEXes since those are allowed to compile
+ // against unstable APIs.
+ modules = removeAll(modules, non_updatable_modules)
+ // First create updatable-framework-module-impl, which contains all updatable modules.
+ // This module compiles against module_lib SDK.
+ {
+ props := libraryProps{}
+ props.Name = proptools.StringPtr("updatable-framework-module-impl")
+ props.Static_libs = transformArray(modules, "", ".impl")
+ props.Sdk_version = proptools.StringPtr("module_current")
+ props.Visibility = []string{"//frameworks/base"}
+ ctx.CreateModule(java.LibraryFactory, &props)
+ }
+
+ // Now create all-framework-module-impl, which contains updatable-framework-module-impl
+ // and all non-updatable modules. This module compiles against hidden APIs.
+ {
+ props := libraryProps{}
+ props.Name = proptools.StringPtr("all-framework-module-impl")
+ props.Static_libs = transformArray(non_updatable_modules, "", ".impl")
+ props.Static_libs = append(props.Static_libs, "updatable-framework-module-impl")
+ props.Sdk_version = proptools.StringPtr("core_platform")
+ props.Visibility = []string{"//frameworks/base"}
+ ctx.CreateModule(java.LibraryFactory, &props)
+ }
}
func createMergedFrameworkModuleLibStubs(ctx android.LoadHookContext, modules []string) {