Merge "java_sdk_library: Simplify SdkLibrary.sdkJars" am: 3f82e2426e am: 327b94a92a

Change-Id: Icc22089165dbb0e0b6111e3fc6df62144177bd72
This commit is contained in:
Treehugger Robot
2020-05-26 16:16:59 +00:00
committed by Automerger Merge Worker

View File

@@ -1298,14 +1298,15 @@ func PrebuiltJars(ctx android.BaseModuleContext, baseName string, s sdkSpec) and
func (module *SdkLibrary) sdkJars(ctx android.BaseModuleContext, sdkVersion sdkSpec, headerJars bool) android.Paths {
// Check any special cases for java_sdk_library.
if !sdkVersion.specified() {
//
// Only allow access to the implementation library in the following condition:
// * No sdk_version specified on the referencing module.
if sdkVersion.kind == sdkPrivate {
if headerJars {
return module.HeaderJars()
} else {
return module.ImplementationJars()
}
} else if sdkVersion.kind == sdkPrivate {
return module.HeaderJars()
}
return module.selectHeaderJarsForSdkVersion(ctx, sdkVersion)