Fix coverage when transitive jars are enabled

Coverage instrumentation is performed on the combined jar contaning
all the transitive dependencies, replace the exported list of
transitive dependencies with the instrumented jar.

Bug: 368161965
Test: all soong tests pass
Flag: EXEMPT bugfix
Change-Id: I1f417f5b4dc8e895eb1800da39121e0aefc754d9
diff --git a/java/base.go b/java/base.go
index ef299b2..f9e1b38 100644
--- a/java/base.go
+++ b/java/base.go
@@ -1736,7 +1736,9 @@
 	}
 
 	if j.shouldInstrument(ctx) {
-		outputFile = j.instrument(ctx, flags, outputFile, jarName, specs)
+		instrumentedOutputFile := j.instrument(ctx, flags, outputFile, jarName, specs)
+		completeStaticLibsImplementationJars = android.NewDepSet(android.PREORDER, android.Paths{instrumentedOutputFile}, nil)
+		outputFile = instrumentedOutputFile
 	}
 
 	// merge implementation jar with resources if necessary