Mark "Ravenwood-tests" and "robo-test" modules as being TestOnly and top-level-tests for code coverage reporting.

Fixes: 402451184
Tests: m nothing --no-skip-soong-tests blueprint_tests
Tests: go test ./java
Tests: m all_teams && gqui from  "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'

+--------------------------+----------+
|        teams.kind        | count(*) |
+--------------------------+----------+
| android_ravenwood_test   |       37 |
| android_robolectric_test |      118 |
| android_test             |     2230 |
| android_test_helper_app  |     2125 |
...

Change-Id: Ib81b6d261a3088aed44ea4d74452f99ff0f3d587
diff --git a/java/robolectric.go b/java/robolectric.go
index be369f7..1d204a4 100644
--- a/java/robolectric.go
+++ b/java/robolectric.go
@@ -284,6 +284,11 @@
 	android.SetProvider(ctx, android.TestSuiteInfoProvider, android.TestSuiteInfo{
 		TestSuites: r.TestSuites(),
 	})
+
+	android.SetProvider(ctx, android.TestOnlyProviderKey, android.TestModuleInformation{
+		TestOnly:       Bool(r.sourceProperties.Test_only),
+		TopLevelTarget: r.sourceProperties.Top_level_test_target,
+	})
 }
 
 func generateSameDirRoboTestConfigJar(ctx android.ModuleContext, outputFile android.ModuleOutPath) {
@@ -335,7 +340,8 @@
 
 	module.Module.dexpreopter.isTest = true
 	module.Module.linter.properties.Lint.Test_module_type = proptools.BoolPtr(true)
-
+	module.Module.sourceProperties.Test_only = proptools.BoolPtr(true)
+	module.Module.sourceProperties.Top_level_test_target = true
 	module.testProperties.Test_suites = []string{"robolectric-tests"}
 
 	InitJavaModule(module, android.DeviceSupported)