Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint.
This is to unify boot jars with system server jars:
PRODUCT_SYSTEM_SERVER_JARS and PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
do not overlap.
Test: aosp_walleye-userdebug boots
Exempt-From-Owner-Approval: cherry-pick.
Bug: 146363577
Change-Id: If001049a46f8e9d38921dabeedbd61e971ebfe73
Merged-In: If001049a46f8e9d38921dabeedbd61e971ebfe73
(cherry picked from commit ef4358e536ec3e40843759a203af3043704b7357)
diff --git a/android/config.go b/android/config.go
index d0ac4c3..3c979f2 100644
--- a/android/config.go
+++ b/android/config.go
@@ -923,8 +923,23 @@
return c.productVariables.ModulesLoadedByPrivilegedModules
}
+// 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 (c *config) BootJars() []string {
- return c.productVariables.BootJars
+ jars := c.productVariables.BootJars
+ for _, p := range c.productVariables.UpdatableBootJars {
+ _, jar := SplitApexJarPair(p)
+ jars = append(jars, jar)
+ }
+ return jars
}
func (c *config) DexpreoptGlobalConfig(ctx PathContext) ([]byte, error) {
diff --git a/android/variable.go b/android/variable.go
index 58e5940..e4a3fa3 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -230,7 +230,8 @@
UncompressPrivAppDex *bool `json:",omitempty"`
ModulesLoadedByPrivilegedModules []string `json:",omitempty"`
- BootJars []string `json:",omitempty"`
+ BootJars []string `json:",omitempty"`
+ UpdatableBootJars []string `json:",omitempty"`
IntegerOverflowExcludePaths []string `json:",omitempty"`
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index ac5b691..2074339 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -102,7 +102,7 @@
// Don't preopt system server jars that are updatable.
for _, p := range global.UpdatableSystemServerJars {
- if _, jar := SplitApexJarPair(p); jar == module.Name {
+ if _, jar := android.SplitApexJarPair(p); jar == module.Name {
return true
}
}
@@ -537,18 +537,8 @@
}
// 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]
-}
-
-// Expected format for apexJarValue = <apex name>:<jar name>
func GetJarLocationFromApexJarPair(apexJarValue string) string {
- apex, jar := SplitApexJarPair(apexJarValue)
+ apex, jar := android.SplitApexJarPair(apexJarValue)
return filepath.Join("/apex", apex, "javalib", jar+".jar")
}
diff --git a/java/dexpreopt_config.go b/java/dexpreopt_config.go
index 4c9add8..57b6125 100644
--- a/java/dexpreopt_config.go
+++ b/java/dexpreopt_config.go
@@ -115,16 +115,16 @@
func getJarsFromApexJarPairs(apexJarPairs []string) []string {
modules := make([]string, len(apexJarPairs))
for i, p := range apexJarPairs {
- _, jar := dexpreopt.SplitApexJarPair(p)
+ _, jar := android.SplitApexJarPair(p)
modules[i] = jar
}
return modules
}
var (
- bootImageConfigKey = android.NewOnceKey("bootImageConfig")
- artBootImageName = "art"
- frameworkBootImageName = "boot"
+ bootImageConfigKey = android.NewOnceKey("bootImageConfig")
+ artBootImageName = "art"
+ frameworkBootImageName = "boot"
)
// Construct the global boot image configs.
@@ -179,8 +179,8 @@
}
configs := map[string]*bootImageConfig{
- artBootImageName: &artCfg,
- frameworkBootImageName: &frameworkCfg,
+ artBootImageName: &artCfg,
+ frameworkBootImageName: &frameworkCfg,
}
// common to all configs