apex: checks min_sdk_version for preview/current
If we don't check "current", it won't be checked even in the finalized branch. If we don't check "preview", it should be done during the SDK finalization. It'd be better done before the SDK finalization regarding that setting min_sdk_version is to get approval from deps library owners. Bug: 177833148 Test: m (soong tests) Change-Id: I712b61cfe5a134fbb69c73956d26fb3a1e5c011e
This commit is contained in:
@@ -830,9 +830,8 @@ func CheckMinSdkVersion(m UpdatableModule, ctx ModuleContext, minSdkVersion ApiL
|
||||
return
|
||||
}
|
||||
|
||||
// do not enforce deps.min_sdk_version if APEX/APK doesn't set min_sdk_version or
|
||||
// min_sdk_version is not finalized (e.g. current or codenames)
|
||||
if minSdkVersion.IsCurrent() {
|
||||
// do not enforce deps.min_sdk_version if APEX/APK doesn't set min_sdk_version
|
||||
if minSdkVersion.IsNone() {
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -81,6 +81,10 @@ func (this ApiLevel) IsCurrent() bool {
|
||||
return this.value == "current"
|
||||
}
|
||||
|
||||
func (this ApiLevel) IsNone() bool {
|
||||
return this.number == -1
|
||||
}
|
||||
|
||||
// Returns -1 if the current API level is less than the argument, 0 if they
|
||||
// are equal, and 1 if it is greater than the argument.
|
||||
func (this ApiLevel) CompareTo(other ApiLevel) int {
|
||||
|
Reference in New Issue
Block a user