From bd58e746928bdfd618ba81e66a19dc42f7b15380 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Thu, 11 May 2023 15:58:13 +0000 Subject: [PATCH] Revert "Make min_sdk overridable in override_apex" This reverts commit 133c55b48abe73a51efc6f7cd30b6b6e318ba6f9. Reason for revert: change was untested and not working Change-Id: I06d6e3c439ba541ae85dc148f91b184b9731b92d --- apex/apex.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apex/apex.go b/apex/apex.go index a9c8afce7..ae5dd3bf6 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -124,6 +124,10 @@ type apexBundleProperties struct { // List of filesystem images that are embedded inside this APEX bundle. Filesystems []string + // The minimum SDK version that this APEX must support at minimum. This is usually set to + // the SDK version that the APEX was first introduced. + Min_sdk_version *string + // Whether this APEX is considered updatable or not. When set to true, this will enforce // additional rules for making sure that the APEX is truly updatable. To be updatable, // min_sdk_version should be set as well. This will also disable the size optimizations like @@ -389,10 +393,6 @@ type overridableProperties struct { // Trim against a specific Dynamic Common Lib APEX Trim_against *string - - // The minimum SDK version that this APEX must support at minimum. This is usually set to - // the SDK version that the APEX was first introduced. - Min_sdk_version *string } type apexBundle struct { @@ -2880,7 +2880,7 @@ func (a *apexBundle) minSdkVersionValue(ctx android.EarlyModuleContext) string { // Only override the minSdkVersion value on Apexes which already specify // a min_sdk_version (it's optional for non-updatable apexes), and that its // min_sdk_version value is lower than the one to override with. - minApiLevel := minSdkVersionFromValue(ctx, proptools.String(a.overridableProperties.Min_sdk_version)) + minApiLevel := minSdkVersionFromValue(ctx, proptools.String(a.properties.Min_sdk_version)) if minApiLevel.IsNone() { return "" } @@ -3534,8 +3534,8 @@ func convertWithBp2build(a *apexBundle, ctx android.TopDownMutatorContext) (baze // TODO(b/219503907) this would need to be set to a.MinSdkVersionValue(ctx) but // given it's coming via config, we probably don't want to put it in here. var minSdkVersion bazel.StringAttribute - if a.overridableProperties.Min_sdk_version != nil { - minSdkVersion.SetValue(*a.overridableProperties.Min_sdk_version) + if a.properties.Min_sdk_version != nil { + minSdkVersion.SetValue(*a.properties.Min_sdk_version) } if props, ok := productVariableProps[minSdkVersionPropName]; ok { for c, p := range props {