Revert "Generate boot image profiles even if dexpreopt is disabled."

Revert submission 2574032

Reason for revert: DroidMonitor-triggered revert due to breakage <https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=aosp_cf_riscv64_minidroid-userdebug&lkgb=10069333&lkbb=10075041&fkbb=10071083>, bug <b/280902279>

Reverted changes: /q/submissionid:2574032

Change-Id: I8e99f8231639198b149ea8d822ee7f9a5b391a89
BUG: <280902279>
diff --git a/apex/apex.go b/apex/apex.go
index 5e4d3fc..baf4737 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2675,7 +2675,7 @@
 	}
 
 	pathInApex := bootclasspathFragmentInfo.ProfileInstallPathInApex()
-	if pathInApex != "" {
+	if pathInApex != "" && !java.SkipDexpreoptBootJars(ctx) {
 		pathOnHost := bootclasspathFragmentInfo.ProfilePathOnHost()
 		tempPath := android.PathForModuleOut(ctx, "boot_image_profile", pathInApex)
 
diff --git a/apex/bootclasspath_fragment_test.go b/apex/bootclasspath_fragment_test.go
index 4a661d4..2ddfd03 100644
--- a/apex/bootclasspath_fragment_test.go
+++ b/apex/bootclasspath_fragment_test.go
@@ -497,26 +497,6 @@
 		})
 	})
 
-	t.Run("generate boot image profile even if dexpreopt is disabled", func(t *testing.T) {
-		result := android.GroupFixturePreparers(
-			commonPreparer,
-
-			// Configure some libraries in the art bootclasspath_fragment that match the source
-			// bootclasspath_fragment's contents property.
-			java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"),
-			addSource("foo", "bar"),
-			java.FixtureSetBootImageInstallDirOnDevice("art", "system/framework"),
-			dexpreopt.FixtureDisableDexpreoptBootImages(true),
-		).RunTest(t)
-
-		ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.android.art_image", []string{
-			"etc/boot-image.prof",
-			"etc/classpaths/bootclasspath.pb",
-			"javalib/bar.jar",
-			"javalib/foo.jar",
-		})
-	})
-
 	t.Run("boot image disable generate profile", func(t *testing.T) {
 		result := android.GroupFixturePreparers(
 			commonPreparer,