summaryrefslogtreecommitdiff
path: root/java/app.go
diff options
context:
space:
mode:
author Artur Satayev <satayev@google.com> 2020-04-16 13:43:02 +0100
committer Artur Satayev <satayev@google.com> 2020-04-27 16:26:31 +0100
commitf40fc858a2684d546a786684d78e24e5514e29e7 (patch)
tree25ae9cea098b7d2d2ad0c0bc40e0fc6a2ace61a9 /java/app.go
parent14f42d34af0024a8759ea1eb8d3f40e84492d4a6 (diff)
Do not allow updatable apps without min_sdk_version.
All updatable modules are expected to declare their earliest platform version they support. Bug: 153539598 Test: m Change-Id: I6243d276e5ab25a1007187ad34789ca1b4cc87bf
Diffstat (limited to 'java/app.go')
-rwxr-xr-xjava/app.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/app.go b/java/app.go
index 7d509eea1..5577cdfd2 100755
--- a/java/app.go
+++ b/java/app.go
@@ -112,7 +112,9 @@ type appProperties struct {
IsCoverageVariant bool `blueprint:"mutated"`
// Whether this app is considered mainline updatable or not. When set to true, this will enforce
- // additional rules for making sure that the APK is truly updatable. Default is false.
+ // additional rules to make sure an app can safely be updated. Default is false.
+ // Prefer using other specific properties if build behaviour must be changed; avoid using this
+ // flag for anything but neverallow rules (unless the behaviour change is invisible to owners).
Updatable *bool
}
@@ -262,6 +264,9 @@ func (a *AndroidApp) checkAppSdkVersions(ctx android.ModuleContext) {
if !a.sdkVersion().stable() {
ctx.PropertyErrorf("sdk_version", "Updatable apps must use stable SDKs, found %v", a.sdkVersion())
}
+ if String(a.deviceProperties.Min_sdk_version) == "" {
+ ctx.PropertyErrorf("updatable", "updatable apps must set min_sdk_version.")
+ }
}
a.checkPlatformAPI(ctx)