From 01f6b0a6564bc1d5d890c8626b722120cf6efda2 Mon Sep 17 00:00:00 2001 From: Ulyana Trafimovich Date: Tue, 26 Nov 2019 13:03:00 +0000 Subject: [PATCH] Revert "Do not dexpreopt system server jars from updatable modules." This reverts commit 61c325ebcce0a1e2ac9149d28ae00e69a269dd93. Reason for revert: broken build git_master/cf_x86_phone-userdebug_coverage (likely caused by these changes). Exempt-From-Owner-Approval: revert. Change-Id: I88ddd3af3a6c4ffdaa1fbb881d965356c5c75ad3 --- dexpreopt/dexpreopt.go | 17 ----------------- java/dexpreopt_config.go | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 18a38fbdb..46e0f0a06 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -102,13 +102,6 @@ func dexpreoptDisabled(global GlobalConfig, module ModuleConfig) bool { 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 @@ -544,16 +537,6 @@ func makefileMatch(pattern, s string) bool { } } -// Expected format for apexJarValue = : -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: :", - apexJarValue)) - } - return apexJarPair[0], apexJarPair[1] -} - func contains(l []string, s string) bool { for _, e := range l { if e == s { diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go index 4747c645c..15f11e11c 100644 --- a/java/dexpreopt_config.go +++ b/java/dexpreopt_config.go @@ -15,6 +15,7 @@ package java import ( + "fmt" "path/filepath" "strings" @@ -65,6 +66,16 @@ func setDexpreoptTestGlobalConfig(config android.Config, globalConfig dexpreopt. var dexpreoptGlobalConfigKey = android.NewOnceKey("DexpreoptGlobalConfig") var dexpreoptTestGlobalConfigKey = android.NewOnceKey("TestDexpreoptGlobalConfig") +// Expected format for apexJarValue = : +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: :", + apexJarValue)) + } + return apexJarPair[0], apexJarPair[1] +} + // systemServerClasspath returns the on-device locations of the modules in the system server classpath. It is computed // once the first time it is called for any ctx.Config(), and returns the same slice for all future calls with the same // ctx.Config(). @@ -78,9 +89,9 @@ func systemServerClasspath(ctx android.PathContext) []string { filepath.Join("/system/framework", m+".jar")) } for _, m := range global.UpdatableSystemServerJars { - apex, jar := dexpreopt.SplitApexJarPair(m) + apex, jar := splitApexJarPair(m) systemServerClasspathLocations = append(systemServerClasspathLocations, - filepath.Join("/apex", apex, "javalib", jar+".jar")) + filepath.Join("/apex", apex, "javalib", jar + ".jar")) } return systemServerClasspathLocations })