Merge "Move odexes of non-system apps into system_other"

This commit is contained in:
Anton Hansson 2019-10-14 09:29:10 +00:00 committed by Gerrit Code Review
commit 300a084db6
2 changed files with 4 additions and 4 deletions

View File

@ -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
}
}

View File

@ -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())
}
}
}