summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rwxr-xr-xjava/app.go7
-rw-r--r--java/java.go14
2 files changed, 19 insertions, 2 deletions
diff --git a/java/app.go b/java/app.go
index 6e0ffeb67..9503ec455 100755
--- a/java/app.go
+++ b/java/app.go
@@ -583,6 +583,13 @@ func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string {
return String(a.overridableAppProperties.Certificate)
}
+func (a *AndroidApp) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
+ if IsJniDepTag(ctx.OtherModuleDependencyTag(dep)) {
+ return true
+ }
+ return a.Library.DepIsInSameApex(ctx, dep)
+}
+
// For OutputFileProducer interface
func (a *AndroidApp) OutputFiles(tag string) (android.Paths, error) {
switch tag {
diff --git a/java/java.go b/java/java.go
index a4e91ab9c..c94ea8293 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1717,8 +1717,10 @@ func (j *Module) hasCode(ctx android.ModuleContext) bool {
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
+ // Dependencies other than the static linkage are all considered crossing APEX boundary
+ // Also, a dependency to an sdk member is also considered as such. This is required because
+ // sdk members should be mutated into APEXes. Refer to sdk.sdkDepsReplaceMutator.
+ return depTag == staticLibTag || j.IsInAnySdk()
}
func (j *Module) Stem() string {
@@ -2406,6 +2408,14 @@ func (j *Import) SrcJarArgs() ([]string, android.Paths) {
return nil, nil
}
+func (j *Import) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
+ depTag := ctx.OtherModuleDependencyTag(dep)
+ // dependencies other than the static linkage are all considered crossing APEX boundary
+ // Also, a dependency to an sdk member is also considered as such. This is required because
+ // sdk members should be mutated into APEXes. Refer to sdk.sdkDepsReplaceMutator.
+ return depTag == staticLibTag || j.IsInAnySdk()
+}
+
// Add compile time check for interface implementation
var _ android.IDEInfo = (*Import)(nil)
var _ android.IDECustomizedModuleName = (*Import)(nil)