Do not propagate boot jars in CLC construction

Bootclasspath libraries are shared and available to apps by default.
Propagating the bootclasspath libraries in CLC and adding them in
manifest fixer may lead to discrepancies between the build time CLC and
the run time CLC, making dexpreopt usesless and leading to performance
regression.

Test: m nothing --no-skip-soong-test
Bug: 390048523
Change-Id: I15bc76a83f03e4575a9a7cd7cc821969f2204bf2
diff --git a/dexpreopt/class_loader_context.go b/dexpreopt/class_loader_context.go
index af1d33d..7f50912 100644
--- a/dexpreopt/class_loader_context.go
+++ b/dexpreopt/class_loader_context.go
@@ -291,6 +291,11 @@
 	// For prebuilts, library should have the same name as the source module.
 	lib = android.RemoveOptionalPrebuiltPrefix(lib)
 
+	// Bootclasspath libraries should not be added to CLC.
+	if android.InList(lib, ctx.Config().BootJars()) {
+		return nil
+	}
+
 	devicePath := UnknownInstallLibraryPath
 	if installPath == nil {
 		if android.InList(lib, CompatUsesLibs) || android.InList(lib, OptionalCompatUsesLibs) {