From b9c58350caa1da5414db4bbfe86a6af72ef67278 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 13 May 2024 18:29:45 +0000 Subject: Support min_sdk_version overrides in apps This replaces the global override of min_sdk_version (via `APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE`) with an min_sdk_version override that can be set by each individual soong override_app. The use case for this are go apps which are only installed in T and above, even though the base AOSP apexes might be installable on < T devices. Test: added a unit test Bug: 295311875 Change-Id: Ie2e738a6786bb24417c675617f7c78358017c96c --- java/java.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 05ef5d04f..e3f482450 100644 --- a/java/java.go +++ b/java/java.go @@ -909,7 +909,7 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { // Check min_sdk_version of the transitive dependencies if this module is created from // java_sdk_library. - if j.deviceProperties.Min_sdk_version != nil && j.SdkLibraryName() != nil { + if j.overridableProperties.Min_sdk_version != nil && j.SdkLibraryName() != nil { j.CheckDepsMinSdkVersion(ctx) } @@ -1097,7 +1097,7 @@ func (p *librarySdkMemberProperties) PopulateFromVariant(ctx android.SdkMemberCo // If the min_sdk_version was set then add the canonical representation of the API level to the // snapshot. - if j.deviceProperties.Min_sdk_version != nil { + if j.overridableProperties.Min_sdk_version != nil { canonical, err := android.ReplaceFinalizedCodenames(ctx.SdkModuleContext().Config(), j.minSdkVersion.String()) if err != nil { ctx.ModuleErrorf("%s", err) -- cgit v1.2.3-59-g8ed1b