Revert^2 "Do not dexpreopt system server jars from updatable modules."
This reverts commit 01f6b0a6564bc1d5d890c8626b722120cf6efda2.
Reason for revert: Build failure is not reproducible.
Forrest build on the same build ID 6033773 and same target
cf_x86_phone-userdebug_coverage finished successfully.
Change-Id: I5077f8332aa0b8037e324b89d41f35b86b8cf216
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index 46e0f0a..18a38fb 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -102,6 +102,13 @@
return true
}
+ // Don't preopt system server jars that are updatable.
+ for _, p := range global.UpdatableSystemServerJars {
+ if _, jar := SplitApexJarPair(p); jar == module.Name {
+ return true
+ }
+ }
+
// If OnlyPreoptBootImageAndSystemServer=true and module is not in boot class path skip
// Also preopt system server jars since selinux prevents system server from loading anything from
// /data. If we don't do this they will need to be extracted which is not favorable for RAM usage
@@ -537,6 +544,16 @@
}
}
+// Expected format for apexJarValue = <apex name>:<jar name>
+func SplitApexJarPair(apexJarValue string) (string, string) {
+ var apexJarPair []string = strings.SplitN(apexJarValue, ":", 2)
+ if apexJarPair == nil || len(apexJarPair) != 2 {
+ panic(fmt.Errorf("malformed apexJarValue: %q, expected format: <apex>:<jar>",
+ apexJarValue))
+ }
+ return apexJarPair[0], apexJarPair[1]
+}
+
func contains(l []string, s string) bool {
for _, e := range l {
if e == s {