diff options
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/android/module.go b/android/module.go index 3295e93be..87ff27323 100644 --- a/android/module.go +++ b/android/module.go @@ -1898,7 +1898,7 @@ type CommonModuleInfo struct { SkipAndroidMkProcessing bool BaseModuleName string CanHaveApexVariants bool - MinSdkVersion string + MinSdkVersion ApiLevelOrPlatform SdkVersion string NotAvailableForPlatform bool // There some subtle differences between this one and the one above. @@ -1914,6 +1914,11 @@ type CommonModuleInfo struct { Host bool } +type ApiLevelOrPlatform struct { + ApiLevel *ApiLevel + IsPlatform bool +} + var CommonModuleInfoKey = blueprint.NewProvider[CommonModuleInfo]() type PrebuiltModuleInfo struct { @@ -2255,11 +2260,16 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) MinSdkVersion(ctx EarlyModuleContext) ApiLevel }); ok { ver := mm.MinSdkVersion(ctx) - if !ver.IsNone() { - commonData.MinSdkVersion = ver.String() - } + commonData.MinSdkVersion.ApiLevel = &ver } else if mm, ok := m.module.(interface{ MinSdkVersion() string }); ok { - commonData.MinSdkVersion = mm.MinSdkVersion() + ver := mm.MinSdkVersion() + // Compile against the current platform + if ver == "" { + commonData.MinSdkVersion.IsPlatform = true + } else { + api := ApiLevelFrom(ctx, ver) + commonData.MinSdkVersion.ApiLevel = &api + } } if mm, ok := m.module.(interface { |