summaryrefslogtreecommitdiff
path: root/java/systemserver_classpath_fragment.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2021-06-29 20:04:45 +0100
committer Paul Duffin <paulduffin@google.com> 2021-06-29 23:35:25 +0100
commit56c93e899a355311463d41e988c9ba511af14278 (patch)
treec70289352d3461653e156a185daa0937a2a4ccb4 /java/systemserver_classpath_fragment.go
parent22fd032ccbe6b8352964fc01d961f0d71b20c949 (diff)
Use both module name and stem name to filter updatable boot jars
Sometimes the stem property is set to change both the installed file name and the name use to filter the configured module list, e.g. when adding a test library to replace the standard library, e.g. test_foo instead of foo. Sometimes it is used just to change the installed file name. This change uses both to filter the updatable boot jars and not just the stem. Bug: 180105615 Test: m nothing Change-Id: I6c459fc3597b1e4f062bc9a4e52843305b538c5f
Diffstat (limited to 'java/systemserver_classpath_fragment.go')
-rw-r--r--java/systemserver_classpath_fragment.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go
index 252c6151f..28a5a2cf2 100644
--- a/java/systemserver_classpath_fragment.go
+++ b/java/systemserver_classpath_fragment.go
@@ -106,21 +106,12 @@ func (s *SystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.Mo
func (s *SystemServerClasspathModule) configuredJars(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)
- }
- }
+ possibleUpdatableModules := gatherPossibleUpdatableModuleNamesAndStems(ctx, s.properties.Contents, systemServerClasspathFragmentContentDepTag)
// 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(stems)
+ return global.UpdatableSystemServerJars.Filter(possibleUpdatableModules)
}
type systemServerClasspathFragmentContentDependencyTag struct {