Preopt: Do not strip non-image boot class path jars.

Test: Pixel 2 XL boots.
Bug: 119868597
Change-Id: I7bd3b7655aecf1a8c26dd8d4d18d3eec685ece88
diff --git a/java/java.go b/java/java.go
index fa4aee4..a23835b 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1364,6 +1364,12 @@
 }
 
 func (j *Library) shouldUncompressDex(ctx android.ModuleContext) bool {
+	// Store uncompressed (and do not strip) dex files from boot class path jars that are not
+	// part of the boot image.
+	if inList(ctx.ModuleName(), ctx.Config().BootJars()) &&
+		!inList(ctx.ModuleName(), ctx.Config().PreoptBootJars()) {
+		return true
+	}
 	return false
 }