From a2e7d238e77a0b4ec6cf493719638e2b15984c31 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 24 Jun 2024 21:07:26 +0000 Subject: [PATCH] Install dexpreopt artifacts of non_system apps in system_other `SYSTEM_OTHER_ODEX_FILTER` is used to determine which odex files go in system_other partition. Soong code adds another filter on top of that. This additional filter limits the odex files to only system apps, which means that dexpreopt artifacts of product and system_ext apps are **not** installed in system_other. This CL removes this additional filter. After this CL, dexpreopt artifacts of product and system_ext apps will be installed in system_other. Bug: 349083274 Test: Verified that .odex files of product apps appear in intalled-files-system_other.txt and not installed-files-product.txt Test: Ran this CL on a bunch of targets in git_main and throttled branchesa (there are some unrelated errors on some targets) https://android-build.corp.google.com/builds/abtd/run/L93000030004826539 https://android-build.corp.google.com/builds/abtd/run/L53400030004824781 https://android-build.corp.google.com/builds/abtd/run/L41900030004824724 https://android-build.corp.google.com/builds/abtd/run/L87200030004822630 https://android-build.corp.google.com/builds/abtd/run/L67500030004727048 https://android-build.corp.google.com/builds/abtd/run/L41700030004726610 https://android-build.corp.google.com/builds/abtd/run/L61600030004726607 Change-Id: Ib15dfd2dd4992f246fe86f1e04cec01b5fbed82c --- dexpreopt/dexpreopt.go | 2 +- dexpreopt/dexpreopt_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 93351f1fc..d44cf7ea3 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -532,7 +532,7 @@ func OdexOnSystemOtherByName(name string, dexLocation string, global *GlobalConf } for _, f := range global.PatternsOnSystemOther { - if makefileMatch(filepath.Join(SystemPartition, f), dexLocation) { + if makefileMatch("/" + f, dexLocation) || makefileMatch(filepath.Join(SystemPartition, f), dexLocation) { return true } } diff --git a/dexpreopt/dexpreopt_test.go b/dexpreopt/dexpreopt_test.go index eff2416e5..6f7d3bb67 100644 --- a/dexpreopt/dexpreopt_test.go +++ b/dexpreopt/dexpreopt_test.go @@ -153,7 +153,7 @@ func TestDexPreoptSystemOther(t *testing.T) { moduleTests: []moduleTest{ {module: systemModule, expectedPartition: "system_other/system"}, {module: systemProductModule, expectedPartition: "system_other/system/product"}, - {module: productModule, expectedPartition: "product"}, + {module: productModule, expectedPartition: "system_other/product"}, }, }, }