summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Luca Stefani <luca.stefani.ge1@gmail.com> 2025-03-07 17:41:33 +0100
committer Luca Stefani <luca.stefani.ge1@gmail.com> 2025-03-07 19:52:54 +0100
commit0e1a748d4b96519ed46f9f193be047fd12cfe027 (patch)
tree506be35014e890b1f781806264a00e457cd8c9a0 /java
parentd30afaded26ae565329f4836b3f840fcc8e9e07e (diff)
Use system server jar module stem instead of its name
In the case a system server jar is added as a prebuilt its Name() will prepend prebuilt_ to the module name. By itself this doesn't cause any issue, but the format of PRODUCT_SYSTEM_SERVER_JARS expects the second part to match the "installed" jar and depending on that it fills the AllPlatformSystemServerJars, that now can't be indexed by the Name() of the prebuilt module. To solve the issue use the module stem as GetSystemServerDexLocation will construct a path based on that. Test: m, prebuilt felix-services passes dexpreopt check Change-Id: I7e61b958bb1772109446e56bad7a51dd81e8659e
Diffstat (limited to 'java')
-rw-r--r--java/dexpreopt_check.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/dexpreopt_check.go b/java/dexpreopt_check.go
index c97156541..9d0f539ba 100644
--- a/java/dexpreopt_check.go
+++ b/java/dexpreopt_check.go
@@ -100,7 +100,12 @@ func (m *dexpreoptSystemserverCheck) GenerateAndroidBuildActions(ctx android.Mod
if systemServerJar.InstallInSystemExt() && ctx.Config().InstallApexSystemServerDexpreoptSamePartition() {
partition = ctx.DeviceConfig().SystemExtPath() // system_ext
}
- dexLocation := dexpreopt.GetSystemServerDexLocation(ctx, global, systemServerJar.Name())
+ var dexLocation string
+ if m, ok := systemServerJar.(ModuleWithStem); ok {
+ dexLocation = dexpreopt.GetSystemServerDexLocation(ctx, global, m.Stem())
+ } else {
+ ctx.PropertyErrorf("dexpreopt_systemserver_check", "%v is not a ModuleWithStem", systemServerJar.Name())
+ }
odexLocation := dexpreopt.ToOdexPath(dexLocation, targets[0].Arch.ArchType, partition)
odexPath := getInstallPath(ctx, odexLocation)
vdexPath := getInstallPath(ctx, pathtools.ReplaceExtension(odexLocation, "vdex"))