diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 4dbda49b3..304935ee6 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -568,7 +568,8 @@ func OdexOnSystemOtherByName(name string, dexLocation string, global *GlobalConf } 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 ec3154903..727081c7d 100644 --- a/dexpreopt/dexpreopt_test.go +++ b/dexpreopt/dexpreopt_test.go @@ -109,13 +109,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"}, }, }, } @@ -135,7 +134,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()) } } }