diff options
author | 2024-09-18 00:56:52 +0000 | |
---|---|---|
committer | 2024-09-18 16:46:38 +0000 | |
commit | ddda6ea7d3a9ecaad57df85359b43d10bc32648c (patch) | |
tree | 78b6824b7b3f4d980a5690092f6fb8e347881e82 /java/java.go | |
parent | 0bfceee17855cb2e47e512073d639f797fd31f7b (diff) |
Align CLC add context behavior between java_sdk_library and its impl lib
This change allows the impl lib of java_sdk_library to call AddContext(...) instead of AddContextMap(...) and ensure that the behavior between the top level java_sdk_library and the impl lib is identical when creating the class loader context.
Test: CI && ABTD
Bug: 366572133
Change-Id: Ia0bc7558ca737fcd3ad4ed62b3190aa567aa103f
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index cdd48d7bc..d63bbe6e1 100644 --- a/java/java.go +++ b/java/java.go @@ -3345,6 +3345,10 @@ func addCLCFromDep(ctx android.ModuleContext, depModule android.Module, if lib, ok := depModule.(SdkLibraryDependency); ok && lib.sharedLibrary() { // A shared SDK library. This should be added as a top-level CLC element. sdkLib = &depName + } else if lib, ok := depModule.(SdkLibraryComponentDependency); ok && lib.OptionalSdkLibraryImplementation() != nil { + if depModule.Name() == proptools.String(lib.OptionalSdkLibraryImplementation())+".impl" { + sdkLib = lib.OptionalSdkLibraryImplementation() + } } else if ulib, ok := depModule.(ProvidesUsesLib); ok { // A non-SDK library disguised as an SDK library by the means of `provides_uses_lib` // property. This should be handled in the same way as a shared SDK library. |