Use stem when filtering boot jars.
For testing purposes, a boot jar may be provided by a test java_library that has a different content name, but sets "stem" property to match the original java_library. Given that Stem() returns either the property value or module name, it is safe to replace all content names by their stems. Bug: 180105615 Test: atest CtsClasspathsTestCases sdkextensions_e2e_tests Merged-In: Ic519ffa0c5b616abddf15b41c934421dfac2e78a Change-Id: Ic519ffa0c5b616abddf15b41c934421dfac2e78a
This commit is contained in:
@@ -97,10 +97,21 @@ func (s *SystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.Mo
|
||||
func (s *SystemServerClasspathModule) ClasspathFragmentToConfiguredJarList(ctx android.ModuleContext) android.ConfiguredJarList {
|
||||
global := dexpreopt.GetGlobalConfig(ctx)
|
||||
|
||||
// Convert content names to their appropriate stems, in case a test library is overriding an actual boot jar
|
||||
var stems []string
|
||||
for _, name := range s.properties.Contents {
|
||||
dep := ctx.GetDirectDepWithTag(name, systemServerClasspathFragmentContentDepTag)
|
||||
if m, ok := dep.(ModuleWithStem); ok {
|
||||
stems = append(stems, m.Stem())
|
||||
} else {
|
||||
ctx.PropertyErrorf("contents", "%v is not a ModuleWithStem", name)
|
||||
}
|
||||
}
|
||||
|
||||
// Only create configs for updatable boot jars. Non-updatable system server jars must be part of the
|
||||
// platform_systemserverclasspath's classpath proto config to guarantee that they come before any
|
||||
// updatable jars at runtime.
|
||||
return global.UpdatableSystemServerJars.Filter(s.properties.Contents)
|
||||
return global.UpdatableSystemServerJars.Filter(stems)
|
||||
}
|
||||
|
||||
type systemServerClasspathFragmentContentDependencyTag struct {
|
||||
|
Reference in New Issue
Block a user