Propagate min_sdk_version to apexer

This way it will be correctly set in the auto-generated
AndroidManifest.xml.

Bug: 171096530
Bug: 157078772
Test: m
Merged-In: I268f08ca5dd17fa9d6763ad70cc9a3f83891a8d6
Change-Id: I8c2cf076f6353f977e8c532d2c8013bf4ebadc36
This commit is contained in:
Nikita Ioffe 2020-11-05 22:55:37 +00:00
parent b7d0925ef0
commit 53db974559
1 changed files with 4 additions and 7 deletions

View File

@ -469,13 +469,10 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
optFlags = append(optFlags, "--android_manifest "+androidManifestFile.String())
}
targetSdkVersion := ctx.Config().DefaultAppTargetSdk()
// TODO(b/157078772): propagate min_sdk_version to apexer.
minSdkVersion := ctx.Config().DefaultAppTargetSdk()
if a.minSdkVersion(ctx) == android.SdkVersion_Android10 {
minSdkVersion = strconv.Itoa(a.minSdkVersion(ctx))
}
minSdkVersion := strconv.Itoa(a.minSdkVersion(ctx))
// apex module doesn't have a concept of target_sdk_version, hence for the time being
// targetSdkVersion == default targetSdkVersion of the branch.
targetSdkVersion := strconv.Itoa(ctx.Config().DefaultAppTargetSdkInt())
if java.UseApiFingerprint(ctx) {
targetSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", java.ApiFingerprintPath(ctx).String())