aboutsummaryrefslogtreecommitdiff
path: root/apex
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2023-03-03 21:20:36 +0000
committerSpandan Das <spandandas@google.com>2023-03-20 16:51:32 +0000
commite773739787394e9632043749e88ca6cfd5a40a67 (patch)
treec069277b81df80f608af7f97b33e62c3e0d18ff8 /apex
parent3015e38a5f0d466dd850fd0a77648844a1364efc (diff)
downloadsoong-e773739787394e9632043749e88ca6cfd5a40a67.tar.gz
Update min_sdk_version from SdkSpec to ApiLevel
min_sdk_version signifies device version and does not need an sdkKind to describe it fully. Update the type and cleanup existing usages. As a side benefit, we also get better error handling since users can no longer enter something like `public_30` as a valid min_sdk_version in bp files Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a followup CL Test: m nothing Test: no change in ninja files (this should be a no-op) Bug: 208456999 Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
Diffstat (limited to 'apex')
-rw-r--r--apex/apex.go8
-rw-r--r--apex/builder.go8
2 files changed, 6 insertions, 10 deletions
diff --git a/apex/apex.go b/apex/apex.go
index b2ca6c480..9e9d74211 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2946,12 +2946,8 @@ func (a *apexBundle) minSdkVersionValue(ctx android.EarlyModuleContext) string {
}
// Returns apex's min_sdk_version SdkSpec, honoring overrides
-func (a *apexBundle) MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec {
- return android.SdkSpec{
- Kind: android.SdkNone,
- ApiLevel: a.minSdkVersion(ctx),
- Raw: a.minSdkVersionValue(ctx),
- }
+func (a *apexBundle) MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel {
+ return a.minSdkVersion(ctx)
}
// Returns apex's min_sdk_version ApiLevel, honoring overrides
diff --git a/apex/builder.go b/apex/builder.go
index ee6c473bd..45c52671c 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1063,10 +1063,10 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
} else {
toMinSdkVersion := "(no version)"
if m, ok := to.(interface {
- MinSdkVersion(ctx android.EarlyModuleContext) android.SdkSpec
+ MinSdkVersion(ctx android.EarlyModuleContext) android.ApiLevel
}); ok {
- if v := m.MinSdkVersion(ctx); !v.ApiLevel.IsNone() {
- toMinSdkVersion = v.ApiLevel.String()
+ if v := m.MinSdkVersion(ctx); !v.IsNone() {
+ toMinSdkVersion = v.String()
}
} else if m, ok := to.(interface{ MinSdkVersion() string }); ok {
// TODO(b/175678607) eliminate the use of MinSdkVersion returning
@@ -1087,7 +1087,7 @@ func (a *apexBundle) buildApexDependencyInfo(ctx android.ModuleContext) {
return !externalDep
})
- a.ApexBundleDepsInfo.BuildDepsInfoLists(ctx, a.MinSdkVersion(ctx).Raw, depInfos)
+ a.ApexBundleDepsInfo.BuildDepsInfoLists(ctx, a.MinSdkVersion(ctx).String(), depInfos)
ctx.Build(pctx, android.BuildParams{
Rule: android.Phony,