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
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 7d21b7a..2c86942 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -171,11 +171,11 @@
 	// Now match the apex part of the boot image configuration.
 	requiredApex := configuredBootJars.Apex(index)
 	if android.IsConfiguredJarForPlatform(requiredApex) {
-		if len(apexInfo.InApexVariants) != 0 {
+		if apexInfo.ApexVariationName != "" {
 			// A platform variant is required but this is for an apex so ignore it.
 			return false
 		}
-	} else if !apexInfo.InApexVariant(requiredApex) {
+	} else if apexInfo.BaseApexName != requiredApex {
 		// An apex variant for a specific apex is required but this is the wrong apex.
 		return false
 	}