Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
Merged-In: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
(cherry picked from commit ad99149a62
)
This commit is contained in:
@@ -908,6 +908,7 @@ type WalkPayloadDepsFunc func(ctx ModuleContext, do PayloadDepsCallback)
|
|||||||
// ModuleWithMinSdkVersionCheck represents a module that implements min_sdk_version checks
|
// ModuleWithMinSdkVersionCheck represents a module that implements min_sdk_version checks
|
||||||
type ModuleWithMinSdkVersionCheck interface {
|
type ModuleWithMinSdkVersionCheck interface {
|
||||||
Module
|
Module
|
||||||
|
MinSdkVersion(ctx EarlyModuleContext) SdkSpec
|
||||||
CheckMinSdkVersion(ctx ModuleContext)
|
CheckMinSdkVersion(ctx ModuleContext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
apex/apex.go
12
apex/apex.go
@@ -2245,6 +2245,8 @@ func overrideApexFactory() android.Module {
|
|||||||
//
|
//
|
||||||
// TODO(jiyong): move these checks to a separate go file.
|
// TODO(jiyong): move these checks to a separate go file.
|
||||||
|
|
||||||
|
var _ android.ModuleWithMinSdkVersionCheck = (*apexBundle)(nil)
|
||||||
|
|
||||||
// Entures that min_sdk_version of the included modules are equal or less than the min_sdk_version
|
// Entures that min_sdk_version of the included modules are equal or less than the min_sdk_version
|
||||||
// of this apexBundle.
|
// of this apexBundle.
|
||||||
func (a *apexBundle) CheckMinSdkVersion(ctx android.ModuleContext) {
|
func (a *apexBundle) CheckMinSdkVersion(ctx android.ModuleContext) {
|
||||||
@@ -2256,7 +2258,15 @@ func (a *apexBundle) CheckMinSdkVersion(ctx android.ModuleContext) {
|
|||||||
android.CheckMinSdkVersion(ctx, minSdkVersion, a.WalkPayloadDeps)
|
android.CheckMinSdkVersion(ctx, minSdkVersion, a.WalkPayloadDeps)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *apexBundle) minSdkVersion(ctx android.BaseModuleContext) android.ApiLevel {
|
func (a *apexBundle) MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
|
||||||
|
return android.SdkSpec{
|
||||||
|
Kind: android.SdkNone,
|
||||||
|
ApiLevel: a.minSdkVersion(ctx),
|
||||||
|
Raw: String(a.properties.Min_sdk_version),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (a *apexBundle) minSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel {
|
||||||
ver := proptools.String(a.properties.Min_sdk_version)
|
ver := proptools.String(a.properties.Min_sdk_version)
|
||||||
if ver == "" {
|
if ver == "" {
|
||||||
return android.NoneApiLevel
|
return android.NoneApiLevel
|
||||||
|
Reference in New Issue
Block a user