android_app APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE

Currently the product variable that is controlled by
APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE only overrides apexes, but it
doesn't apply to android_apps. This commit allows android_apps which set
updatable: true in their Android.bp to have their min_sdk_version be
overriden by this product variable.

Bug: 295311875
Test: go test
Change-Id: If3cb82a17cae4553b577dd1a4637ee13c3c95302
This commit is contained in:
Sam Delmerico
2023-08-18 22:43:28 +00:00
parent 8d7f2e41d1
commit 0e0d96efa7
4 changed files with 73 additions and 16 deletions

View File

@@ -934,6 +934,19 @@ func CheckMinSdkVersion(ctx ModuleContext, minSdkVersion ApiLevel, walk WalkPayl
})
}
// Construct ApiLevel object from min_sdk_version string value
func MinSdkVersionFromValue(ctx EarlyModuleContext, value string) ApiLevel {
if value == "" {
return NoneApiLevel
}
apiLevel, err := ApiLevelFromUser(ctx, value)
if err != nil {
ctx.PropertyErrorf("min_sdk_version", "%s", err.Error())
return NoneApiLevel
}
return apiLevel
}
// Implemented by apexBundle.
type ApexTestInterface interface {
// Return true if the apex bundle is an apex_test