Revert "Revert "Remove option to create boot image based on preloaded classes""

Test: make
Test: build/soong/scripts/build-ndk-prebuilts.sh

This reverts commit d3f688b521438556f62495d2ed7cacc3a2768b36.

Change-Id: Ia8898d11d67e5f0c4d8886f13d29f5dbd5f8609b
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index eb735c1..fe468a9 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -286,8 +286,6 @@
 	if profile != nil {
 		cmd.FlagWithArg("--compiler-filter=", "speed-profile")
 		cmd.FlagWithInput("--profile-file=", profile)
-	} else if global.PreloadedClasses.Valid() {
-		cmd.FlagWithInput("--image-classes=", global.PreloadedClasses.Path())
 	}
 
 	if global.DirtyImageObjects.Valid() {
@@ -374,7 +372,7 @@
 func bootImageProfileRule(ctx android.SingletonContext, image *bootImage, missingDeps []string) android.WritablePath {
 	global := dexpreoptGlobalConfig(ctx)
 
-	if !global.UseProfileForBootImage || ctx.Config().IsPdkBuild() || ctx.Config().UnbundledBuild() {
+	if global.DisableGenerateProfile || ctx.Config().IsPdkBuild() || ctx.Config().UnbundledBuild() {
 		return nil
 	}
 	return ctx.Config().Once(bootImageProfileRuleKey, func() interface{} {