aboutsummaryrefslogtreecommitdiffstats
path: root/dexpreopt
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2019-10-02 18:14:02 +0100
committerAnton Hansson <hansson@google.com>2019-10-03 14:52:37 +0100
commit12b8d427c799de0ff38fea4c71729b794b84eec6 (patch)
treeaa979d5c0a80402d730df9c99b6e2084425c6270 /dexpreopt
parent43ab0bc24a3c20830e49561b4372f4a544bdf56f (diff)
downloadbuild_soong-12b8d427c799de0ff38fea4c71729b794b84eec6.tar.gz
build_soong-12b8d427c799de0ff38fea4c71729b794b84eec6.tar.bz2
build_soong-12b8d427c799de0ff38fea4c71729b794b84eec6.zip
Move odexes of non-system apps into system_other
Previously, the patterns in SYSTEM_OTHER_ODEX_FILTER only matched subpaths of /system. Broaden this to match /<p> as well as /system/<p>. Because SYSTEM_OTHER_ODEX_FILTER includes system_ext and product apps, the immediate effect of this is that the odex and vdex files of apps on those partitions move to system_other for A/B devices. This makes the product and system_ext partitions smaller, which in turn makes OTAs smaller. Bug: 141707536 Test: soong unit tests Test: (adb shell dumpsys package com.android.stk && adb shell dumpsys package com.android.quicksearchbox) | grep -i dexopt -A3; verify dexpreopt state is 'prebuilt' for both Test: adb shell find /data/dalvik-cache -name '*QuickSearch*.vdex' | wc -l == 1 Test: adb shell find /data/dalvik-cache -name '*Stk*.vdex' | wc -l == 1 Change-Id: I6e1e6d89c5822d48b522e7e6d77a363ed9f0e05b
Diffstat (limited to 'dexpreopt')
-rw-r--r--dexpreopt/dexpreopt.go3
-rw-r--r--dexpreopt/dexpreopt_test.go5
2 files changed, 4 insertions, 4 deletions
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index 40644a35..511b8400 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -581,7 +581,8 @@ func OdexOnSystemOtherByName(name string, dexLocation string, global GlobalConfi
}
for _, f := range global.PatternsOnSystemOther {
- if makefileMatch(filepath.Join(SystemPartition, f), dexLocation) {
+ // See comment of SYSTEM_OTHER_ODEX_FILTER for details on the matching.
+ 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 aca5e63a..bf692feb 100644
--- a/dexpreopt/dexpreopt_test.go
+++ b/dexpreopt/dexpreopt_test.go
@@ -122,13 +122,12 @@ func TestDexPreoptSystemOther(t *testing.T) {
{module: productModule, expectedPartition: "product"},
},
},
- // product/app/% only applies to product apps inside the system partition
{
patterns: []string{"app/%", "product/app/%"},
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"},
},
},
}
@@ -148,7 +147,7 @@ func TestDexPreoptSystemOther(t *testing.T) {
}
if rule.Installs().String() != wantInstalls.String() {
- t.Errorf("\nwant installs:\n %v\ngot:\n %v", wantInstalls, rule.Installs())
+ t.Errorf("\npatterns: %v\nwant installs:\n %v\ngot:\n %v", test.patterns, wantInstalls, rule.Installs())
}
}
}