summaryrefslogtreecommitdiff
path: root/android/api_levels.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2024-12-03 16:40:08 -0800
committer Colin Cross <ccross@android.com> 2025-02-10 19:55:26 -0800
commit1cea5308a7915665d8d3480021ca2da00f5206eb (patch)
tree67c5a61b9257166cced772791550e28db4487b5e /android/api_levels.go
parent92b0eb18e199f44ddc26b32ae993d9909f1fd7fa (diff)
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
Diffstat (limited to 'android/api_levels.go')
-rw-r--r--android/api_levels.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/android/api_levels.go b/android/api_levels.go
index 2b1d01d8b..b4fa251bc 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -311,7 +311,7 @@ func ReplaceFinalizedCodenames(config Config, raw string) (string, error) {
// ApiLevelFrom converts the given string `raw` to an ApiLevel.
// If `raw` is invalid (empty string, unrecognized codename etc.) it returns an invalid ApiLevel
-func ApiLevelFrom(ctx PathContext, raw string) ApiLevel {
+func ApiLevelFrom(ctx ConfigContext, raw string) ApiLevel {
ret, err := ApiLevelFromUser(ctx, raw)
if err != nil {
return NewInvalidApiLevel(raw)
@@ -333,7 +333,7 @@ func ApiLevelFrom(ctx PathContext, raw string) ApiLevel {
//
// Inputs that are not "current", known previews, or convertible to an integer
// will return an error.
-func ApiLevelFromUser(ctx PathContext, raw string) (ApiLevel, error) {
+func ApiLevelFromUser(ctx ConfigContext, raw string) (ApiLevel, error) {
return ApiLevelFromUserWithConfig(ctx.Config(), raw)
}
@@ -413,7 +413,7 @@ func ApiLevelForTest(raw string) ApiLevel {
// Converts an API level string `raw` into an ApiLevel in the same method as
// `ApiLevelFromUser`, but the input is assumed to have no errors and any errors
// will panic instead of returning an error.
-func ApiLevelOrPanic(ctx PathContext, raw string) ApiLevel {
+func ApiLevelOrPanic(ctx ConfigContext, raw string) ApiLevel {
value, err := ApiLevelFromUser(ctx, raw)
if err != nil {
panic(err.Error())