Revert "Dexpreopt soong modules inside soong"

This reverts commit 29ff88741e710b05743dcf347484c31311e81cda.

Test: none
Bug: 119412419
diff --git a/java/java.go b/java/java.go
index aea1ef9..5ed99f7 100644
--- a/java/java.go
+++ b/java/java.go
@@ -217,6 +217,25 @@
 	// If set to true, compile dex regardless of installable.  Defaults to false.
 	Compile_dex *bool
 
+	Dex_preopt struct {
+		// If false, prevent dexpreopting and stripping the dex file from the final jar.  Defaults to
+		// true.
+		Enabled *bool
+
+		// If true, generate an app image (.art file) for this module.
+		App_image *bool
+
+		// If true, use a checked-in profile to guide optimization.  Defaults to false unless
+		// a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
+		// that matches the name of this module, in which case it is defaulted to true.
+		Profile_guided *bool
+
+		// If set, provides the path to profile relative to the Android.bp file.  If not set,
+		// defaults to searching for a file that matches the name of this module in the default
+		// profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
+		Profile *string
+	}
+
 	Optimize struct {
 		// If false, disable all optimization.  Defaults to true for android_app and android_test
 		// modules, false for java_library and java_test modules.
@@ -247,7 +266,6 @@
 	System_modules *string
 
 	UncompressDex bool `blueprint:"mutated"`
-	IsSDKLibrary  bool `blueprint:"mutated"`
 }
 
 // Module contains the properties and members used by all java module types
@@ -277,9 +295,6 @@
 	// output file containing classes.dex and resources
 	dexJarFile android.Path
 
-	// output file that contains classes.dex if it should be in the output file
-	maybeStrippedDexJarFile android.Path
-
 	// output file containing uninstrumented classes that will be instrumented by jacoco
 	jacocoReportClassesFile android.Path
 
@@ -312,8 +327,6 @@
 	// list of source files, collected from compiledJavaSrcs and compiledSrcJars
 	// filter out Exclude_srcs, will be used by android.IDEInfo struct
 	expandIDEInfoCompiledSrcs []string
-
-	dexpreopter
 }
 
 func (j *Module) Srcs() android.Paths {
@@ -1319,15 +1332,7 @@
 
 		j.dexJarFile = dexOutputFile
 
-		dexOutputFile = j.dexpreopt(ctx, dexOutputFile)
-
-		j.maybeStrippedDexJarFile = dexOutputFile
-
 		outputFile = dexOutputFile
-
-		if ctx.Failed() {
-			return
-		}
 	} else {
 		outputFile = implementationAndResourcesJar
 	}
@@ -1481,17 +1486,9 @@
 }
 
 func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
-	j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", ctx.ModuleName()+".jar")
-	j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary
 	j.compile(ctx)
 
 	if Bool(j.properties.Installable) || ctx.Host() {
-		if j.deviceProperties.UncompressDex {
-			alignedOutputFile := android.PathForModuleOut(ctx, "aligned", ctx.ModuleName()+".jar")
-			TransformZipAlign(ctx, alignedOutputFile, j.outputFile)
-			j.outputFile = alignedOutputFile
-		}
-
 		j.installFile = ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"),
 			ctx.ModuleName()+".jar", j.outputFile)
 	}
@@ -1507,7 +1504,6 @@
 	module.AddProperties(
 		&module.Module.properties,
 		&module.Module.deviceProperties,
-		&module.Module.dexpreoptProperties,
 		&module.Module.protoProperties)
 
 	InitJavaModule(module, android.HostAndDeviceSupported)
@@ -1578,7 +1574,6 @@
 	module.AddProperties(
 		&module.Module.properties,
 		&module.Module.deviceProperties,
-		&module.Module.dexpreoptProperties,
 		&module.Module.protoProperties,
 		&module.testProperties)
 
@@ -1675,7 +1670,6 @@
 	module.AddProperties(
 		&module.Module.properties,
 		&module.Module.deviceProperties,
-		&module.Module.dexpreoptProperties,
 		&module.Module.protoProperties,
 		&module.binaryProperties)
 
@@ -1895,7 +1889,6 @@
 	module.AddProperties(
 		&CompilerProperties{},
 		&CompilerDeviceProperties{},
-		&DexpreoptProperties{},
 		&android.ProtoProperties{},
 		&aaptProperties{},
 		&androidLibraryProperties{},