Revert "Allow adding extra tradefed options in the Android.bp file"

This reverts commit 8ec823cba166a41eb0e9e5ff8fe679e691fec678.

Reason for revert: DroidMonitor: Potential culprit for Bug b/262965953 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I236cc36981d8b30527ca286632727f8ca267e969
diff --git a/java/java.go b/java/java.go
index dd24376..9dd5850 100644
--- a/java/java.go
+++ b/java/java.go
@@ -888,10 +888,6 @@
 
 	// a list of extra test configuration files that should be installed with the module.
 	Extra_test_configs []string `android:"path,arch_variant"`
-
-	// Extra <option> tags to add to the auto generated test xml file. The "key"
-	// is optional in each of these.
-	Tradefed_options []tradefed.Option
 }
 
 type testProperties struct {
@@ -1170,18 +1166,8 @@
 		j.testProperties.Test_options.Unit_test = proptools.BoolPtr(defaultUnitTest)
 	}
 
-	j.testConfig = tradefed.NewMaybeAutoGenTestConfigBuilder(ctx).
-		SetTestConfigProp(j.testProperties.Test_config).
-		SetTestTemplateConfigProp(j.testProperties.Test_config_template).
-		SetTestSuites(j.testProperties.Test_suites).
-		SetConfig(configs).
-		SetOptionsForAutogenerated(j.testProperties.Test_options.Tradefed_options).
-		SetAutoGenConfig(j.testProperties.Auto_gen_config).
-		SetUnitTest(j.testProperties.Test_options.Unit_test).
-		SetDeviceTemplate("${JavaTestConfigTemplate}").
-		SetHostTemplate("${JavaHostTestConfigTemplate}").
-		SetHostUnitTestTemplate("${JavaHostUnitTestConfigTemplate}").
-		Build()
+	j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.testProperties.Test_config, j.testProperties.Test_config_template,
+		j.testProperties.Test_suites, configs, j.testProperties.Auto_gen_config, j.testProperties.Test_options.Unit_test)
 
 	j.data = android.PathsForModuleSrc(ctx, j.testProperties.Data)
 
@@ -1226,13 +1212,8 @@
 }
 
 func (j *JavaTestImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	j.testConfig = tradefed.NewMaybeAutoGenTestConfigBuilder(ctx).
-		SetTestConfigProp(j.prebuiltTestProperties.Test_config).
-		SetTestSuites(j.prebuiltTestProperties.Test_suites).
-		SetDeviceTemplate("${JavaTestConfigTemplate}").
-		SetHostTemplate("${JavaHostTestConfigTemplate}").
-		SetHostUnitTestTemplate("${JavaHostUnitTestConfigTemplate}").
-		Build()
+	j.testConfig = tradefed.AutoGenJavaTestConfig(ctx, j.prebuiltTestProperties.Test_config, nil,
+		j.prebuiltTestProperties.Test_suites, nil, nil, nil)
 
 	j.Import.GenerateAndroidBuildActions(ctx)
 }