summaryrefslogtreecommitdiff
path: root/java/systemserver_classpath_fragment.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-10-07 23:34:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-10-07 23:34:03 +0000
commita916c24da8fd86952ba6d70f788c696a50832322 (patch)
treea4f173b20edbc074521586a75b3df559256fea5d /java/systemserver_classpath_fragment.go
parent1005d6f910d9b4ad0421d19e957bc23beaac83b2 (diff)
parentfbcd5fe31d17f5576c7c28883e6c2b141e46a75c (diff)
Merge "Enforce partition property on apex system server jars" into main
Diffstat (limited to 'java/systemserver_classpath_fragment.go')
-rw-r--r--java/systemserver_classpath_fragment.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go
index 924abd460..aad106007 100644
--- a/java/systemserver_classpath_fragment.go
+++ b/java/systemserver_classpath_fragment.go
@@ -127,6 +127,26 @@ func (s *SystemServerClasspathModule) GenerateAndroidBuildActions(ctx android.Mo
configuredJars = configuredJars.AppendList(&standaloneConfiguredJars)
classpathJars = append(classpathJars, standaloneClasspathJars...)
s.classpathFragmentBase().generateClasspathProtoBuildActions(ctx, configuredJars, classpathJars)
+ s.setPartitionInfoOfLibraries(ctx)
+}
+
+// Map of java library name to their install partition.
+type LibraryNameToPartitionInfo struct {
+ LibraryNameToPartition map[string]string
+}
+
+// LibraryNameToPartitionInfoProvider will be used by the top-level apex to enforce that dexpreopt files
+// of apex system server jars are installed in the same partition as the top-level apex.
+var LibraryNameToPartitionInfoProvider = blueprint.NewProvider[LibraryNameToPartitionInfo]()
+
+func (s *SystemServerClasspathModule) setPartitionInfoOfLibraries(ctx android.ModuleContext) {
+ libraryNameToPartition := map[string]string{}
+ ctx.VisitDirectDepsWithTag(systemServerClasspathFragmentContentDepTag, func(m android.Module) {
+ libraryNameToPartition[m.Name()] = m.PartitionTag(ctx.DeviceConfig())
+ })
+ android.SetProvider(ctx, LibraryNameToPartitionInfoProvider, LibraryNameToPartitionInfo{
+ LibraryNameToPartition: libraryNameToPartition,
+ })
}
func (s *SystemServerClasspathModule) configuredJars(ctx android.ModuleContext) android.ConfiguredJarList {