summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/base.go6
-rw-r--r--java/sdk_library.go6
2 files changed, 7 insertions, 5 deletions
diff --git a/java/base.go b/java/base.go
index d04e97cb1..b9e236cf0 100644
--- a/java/base.go
+++ b/java/base.go
@@ -716,11 +716,7 @@ func (j *Module) shouldInstrumentInApex(ctx android.BaseModuleContext) bool {
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
isJacocoAgent := ctx.ModuleName() == "jacocoagent"
- isApexVariantSdkLibImplLib := j.SdkLibraryName() != nil &&
- strings.HasSuffix(j.Name(), ".impl") &&
- len(apexInfo.InApexVariants) > 0
-
- if (j.DirectlyInAnyApex() || isApexVariantSdkLibImplLib) && !isJacocoAgent && !apexInfo.IsForPlatform() {
+ if j.DirectlyInAnyApex() && !isJacocoAgent && !apexInfo.IsForPlatform() {
if !inList(ctx.ModuleName(), config.InstrumentFrameworkModules) {
return true
} else if ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") {
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 8c91288c3..72eb6e346 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1506,6 +1506,12 @@ var implLibraryTag = sdkLibraryComponentTag{name: "impl-library"}
var _ android.InstallNeededDependencyTag = sdkLibraryComponentTag{}
+// To satisfy the CopyDirectlyInAnyApexTag interface. Implementation library of the sdk library
+// in an apex is considered to be directly in the apex, as if it was listed in java_libs.
+func (t sdkLibraryComponentTag) CopyDirectlyInAnyApex() {}
+
+var _ android.CopyDirectlyInAnyApexTag = implLibraryTag
+
func (t sdkLibraryComponentTag) InstallDepNeeded() bool {
return t.name == "xml-permissions-file" || t.name == "impl-library"
}