diff options
Diffstat (limited to 'java')
| -rw-r--r-- | java/java.go | 18 | ||||
| -rw-r--r-- | java/sdk_library.go | 14 |
2 files changed, 26 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index d0b5adfa9..8c779f5c4 100644 --- a/java/java.go +++ b/java/java.go @@ -1796,11 +1796,16 @@ 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 + if staticLibTag == ctx.OtherModuleDependencyTag(dep) { + return true + } // 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() + if sa, ok := dep.(android.SdkAware); ok && sa.IsInAnySdk() { + return true + } + return false } func (j *Module) Stem() string { @@ -2504,11 +2509,16 @@ func (j *Import) SrcJarArgs() ([]string, android.Paths) { } 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 + if staticLibTag == ctx.OtherModuleDependencyTag(dep) { + return true + } // 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() + if sa, ok := dep.(android.SdkAware); ok && sa.IsInAnySdk() { + return true + } + return false } // Add compile time check for interface implementation diff --git a/java/sdk_library.go b/java/sdk_library.go index a8edf1d55..6921114bf 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -581,6 +581,14 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc mctx.CreateModule(DroidstubsFactory, &props) } +func (module *SdkLibrary) DepIsInSameApex(mctx android.BaseModuleContext, dep android.Module) bool { + depTag := mctx.OtherModuleDependencyTag(dep) + if depTag == xmlPermissionsFileTag { + return true + } + return module.Library.DepIsInSameApex(mctx, dep) +} + // Creates the xml file that publicizes the runtime library func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) { props := struct { @@ -590,9 +598,11 @@ func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) { Device_specific *bool Product_specific *bool System_ext_specific *bool + Apex_available []string }{ - Name: proptools.StringPtr(module.xmlFileName()), - Lib_name: proptools.StringPtr(module.BaseModuleName()), + Name: proptools.StringPtr(module.xmlFileName()), + Lib_name: proptools.StringPtr(module.BaseModuleName()), + Apex_available: module.ApexProperties.Apex_available, } if module.SocSpecific() { |