From aae9bd11c2e911807686c6bb0be0b9fa96dfcbb0 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 12 Feb 2020 04:36:43 +0900 Subject: sdk_version: "system_server_current" The new sdk version "system_server_current" is for system server components that needs to use all public APIs, system APIs, module APIs, and the system server APIs. Bug: 146757305 Test: m Change-Id: I24fd5af010532a110393676607dc90889f2ec17e --- java/java.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index dd44d06aa..514bab356 100644 --- a/java/java.go +++ b/java/java.go @@ -756,6 +756,7 @@ const ( javaSdk javaSystem javaModule + javaSystemServer javaPlatform ) @@ -789,6 +790,10 @@ func (m *Module) getLinkType(name string) (ret linkType, stubs bool) { return javaModule, true case ver.kind == sdkModule: return javaModule, false + case name == "services-stubs": + return javaSystemServer, true + case ver.kind == sdkSystemServer: + return javaSystemServer, false case ver.kind == sdkPrivate || ver.kind == sdkNone || ver.kind == sdkCorePlatform: return javaPlatform, false case !ver.valid(): @@ -824,17 +829,23 @@ func checkLinkType(ctx android.ModuleContext, from *Module, to linkTypeContext, } break case javaSystem: - if otherLinkType == javaPlatform || otherLinkType == javaModule { + if otherLinkType == javaPlatform || otherLinkType == javaModule || otherLinkType == javaSystemServer { ctx.ModuleErrorf("compiles against system API, but dependency %q is compiling against private API."+commonMessage, ctx.OtherModuleName(to)) } break case javaModule: - if otherLinkType == javaPlatform { + if otherLinkType == javaPlatform || otherLinkType == javaSystemServer { ctx.ModuleErrorf("compiles against module API, but dependency %q is compiling against private API."+commonMessage, ctx.OtherModuleName(to)) } break + case javaSystemServer: + if otherLinkType == javaPlatform { + ctx.ModuleErrorf("compiles against system server API, but dependency %q is compiling against private API."+commonMessage, + ctx.OtherModuleName(to)) + } + break case javaPlatform: // no restriction on link-type break -- cgit v1.2.3-59-g8ed1b