From a7bc8ad0b9ec3f762e45af4d60b96922782616cf Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 15 Oct 2019 15:20:07 +0900 Subject: Prohibit dependencies outside of uses_sdks When an APEX is built with uses_sdks, any depedndency from the APEX to the outside of the APEX should be from the SDKs that the APEX is built against. Bug: 138182343 Test: m Change-Id: I1c2ffe8d28ccf648d928ea59652c2d0070bf10eb --- java/java.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 52f3c11aa..d39c0d20c 100644 --- a/java/java.go +++ b/java/java.go @@ -1567,6 +1567,12 @@ func (j *Module) hasCode(ctx android.ModuleContext) bool { return len(srcFiles) > 0 || len(ctx.GetDirectDepsWithTag(staticLibTag)) > 0 } +func (j *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { + depTag := ctx.OtherModuleDependencyTag(dep) + // dependencies other than the static linkage are all considered crossing APEX boundary + return depTag == staticLibTag +} + // // Java libraries (.jar file) // -- cgit v1.2.3-59-g8ed1b