From 94a76ee86883d2f11a064ce8bd2da226136c6bd3 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 8 Jun 2021 09:49:48 +0900 Subject: [PATCH] Interpret CRT object's min_sdk_version with ApiLevel min_sdk_version values should be interpreted before use. Bug: n/a Test: m (in REL) Change-Id: Ia45f5c7aeb4efcd8daef1deaf54f333dcdd1379d --- cc/cc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go index 7c4ba441e..8bf27d3d7 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1970,9 +1970,13 @@ func GetCrtVariations(ctx android.BottomUpMutatorContext, if minSdkVersion == "" || minSdkVersion == "apex_inherit" { minSdkVersion = m.SdkVersion() } + apiLevel, err := android.ApiLevelFromUser(ctx, minSdkVersion) + if err != nil { + ctx.PropertyErrorf("min_sdk_version", err.Error()) + } return []blueprint.Variation{ {Mutator: "sdk", Variation: "sdk"}, - {Mutator: "version", Variation: minSdkVersion}, + {Mutator: "version", Variation: apiLevel.String()}, } } return []blueprint.Variation{