Move target sdk version enforcement check
Enforce target sdk version flag could only be used by `android_app`, moving the check into a common function `generateAndroidBuildActions`. This would ensure that the `enforce_target_sdk_version` flag can also be set by `android_test` and `android_test_helper_app`. Bug: b/227460469 Test: m nothing Change-Id: I86e0bf684a5083221dae53907d9f548a0390b673
This commit is contained in:
@@ -315,10 +315,6 @@ func (a *AndroidApp) checkAppSdkVersions(ctx android.ModuleContext) {
|
||||
}
|
||||
}
|
||||
|
||||
if Bool(a.appProperties.Enforce_default_target_sdk_version) {
|
||||
a.SetEnforceDefaultTargetSdkVersion(true)
|
||||
}
|
||||
|
||||
a.checkPlatformAPI(ctx)
|
||||
a.checkSdkVersions(ctx)
|
||||
}
|
||||
@@ -639,6 +635,11 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
a.aapt.noticeFile = android.OptionalPathForPath(noticeAssetPath)
|
||||
}
|
||||
|
||||
// For apps targeting latest target_sdk_version
|
||||
if Bool(a.appProperties.Enforce_default_target_sdk_version) {
|
||||
a.SetEnforceDefaultTargetSdkVersion(true)
|
||||
}
|
||||
|
||||
// Process all building blocks, from AAPT to certificates.
|
||||
a.aaptBuildActions(ctx)
|
||||
|
||||
|
Reference in New Issue
Block a user