From 1cea5308a7915665d8d3480021ca2da00f5206eb Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 3 Dec 2024 16:40:08 -0800 Subject: Convert android.TransitionMutator to TransitionInfo Use the ApexInfo instead of a string as the TransitionInfo for apex variations. This removes the need for apexInfoMutator, which is the last remaining top down mutator. This has a variety of ramifications. One is that it is no longer possible to add a dependency onto the apex variation of a module, as that would require constructing a matching ApexInfo. Instead, anything that wants to add a dependency on the apex variation has to depend on the apex instead, and get to the module by walking its transistive dependencies. Another ramification is that modules in apexes can no longer determine which apexes they are in (unless they set UniqueApexVariations so that each variation is in exactly one apex). This prevents some of the existing container violation checks from working after this CL, tracked in b/394955484. It also requires using unique variation names for the prebuilt and source dependencies of apexes, so the apex variations for dependencies of prebuilts now have a prebuilt_ prefix. Bug: 372543712 Bug: 394955484 Test: go test ./... Change-Id: I3d08aca1ac956ab0e343ec3f235a736cd93be0e1 --- android/container.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'android/container.go') diff --git a/android/container.go b/android/container.go index eb2fc1874..5dc97d38e 100644 --- a/android/container.go +++ b/android/container.go @@ -167,8 +167,8 @@ var productContainerBoundaryFunc containerBoundaryFunc = func(mctx ModuleContext } var apexContainerBoundaryFunc containerBoundaryFunc = func(mctx ModuleContext) bool { - _, ok := ModuleProvider(mctx, AllApexInfoProvider) - return ok + // TODO(b/394955484): a module can't determine the apexes it belongs to any more + return false } var ctsContainerBoundaryFunc containerBoundaryFunc = func(mctx ModuleContext) bool { @@ -380,7 +380,7 @@ func (c *ContainersInfo) BelongingContainers() []*container { func (c *ContainersInfo) ApexNames() (ret []string) { for _, apex := range c.belongingApexes { - ret = append(ret, apex.InApexVariants...) + ret = append(ret, apex.BaseApexName) } slices.Sort(ret) return ret @@ -441,14 +441,10 @@ func generateContainerInfo(ctx ModuleContext) ContainersInfo { } } - var belongingApexes []ApexInfo - if apexInfo, ok := ModuleProvider(ctx, AllApexInfoProvider); ok { - belongingApexes = apexInfo.ApexInfos - } - return ContainersInfo{ belongingContainers: containers, - belongingApexes: belongingApexes, + // TODO(b/394955484): a module can't determine the apexes it belongs to any more + belongingApexes: nil, } } -- cgit v1.2.3-59-g8ed1b