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:
11
java/app.go
11
java/app.go
@@ -315,6 +315,17 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
a.generateJavaUsedByApex(ctx)
|
||||
}
|
||||
|
||||
func (a *AndroidApp) MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel {
|
||||
defaultMinSdkVersion := a.Module.MinSdkVersion(ctx)
|
||||
if proptools.Bool(a.appProperties.Updatable) {
|
||||
overrideApiLevel := android.MinSdkVersionFromValue(ctx, ctx.DeviceConfig().ApexGlobalMinSdkVersionOverride())
|
||||
if !overrideApiLevel.IsNone() && overrideApiLevel.CompareTo(defaultMinSdkVersion) > 0 {
|
||||
return overrideApiLevel
|
||||
}
|
||||
}
|
||||
return defaultMinSdkVersion
|
||||
}
|
||||
|
||||
func (a *AndroidApp) checkAppSdkVersions(ctx android.ModuleContext) {
|
||||
if a.Updatable() {
|
||||
if !a.SdkVersion(ctx).Stable() {
|
||||
|
Reference in New Issue
Block a user