Propagate max_sdk_version to manifest_fixer
If max_sdk_version is included in Android.bp that value will now be propagated to manifest_fixer.py. This value will then be used to override any maxSdkVersion attribute set on permission or uses-permission tags in the android manifest if maxSdkVersion="-1". Bug: 223902327 Test: add max_sdk_version to Android.bp for test app Test: create permission in test app manifest with maxSdkVersion="-1" Test: run test to check maxSdkVersion=max_sdk_version Change-Id: Ic533ef2a41b9ecc9ee68c69399026df47ee945b7
This commit is contained in:
@@ -136,6 +136,11 @@ func ManifestFixer(ctx android.ModuleContext, manifest android.Path,
|
||||
ctx.ModuleErrorf("invalid minSdkVersion: %s", err)
|
||||
}
|
||||
|
||||
replaceMaxSdkVersionPlaceholder, err := params.SdkContext.ReplaceMaxSdkVersionPlaceholder(ctx).EffectiveVersion(ctx)
|
||||
if err != nil {
|
||||
ctx.ModuleErrorf("invalid ReplaceMaxSdkVersionPlaceholder: %s", err)
|
||||
}
|
||||
|
||||
if UseApiFingerprint(ctx) && ctx.ModuleName() != "framework-res" {
|
||||
minSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", ApiFingerprintPath(ctx).String())
|
||||
deps = append(deps, ApiFingerprintPath(ctx))
|
||||
@@ -145,6 +150,7 @@ func ManifestFixer(ctx android.ModuleContext, manifest android.Path,
|
||||
ctx.ModuleErrorf("invalid minSdkVersion: %s", err)
|
||||
}
|
||||
args = append(args, "--minSdkVersion ", minSdkVersion)
|
||||
args = append(args, "--replaceMaxSdkVersionPlaceholder ", strconv.Itoa(replaceMaxSdkVersionPlaceholder.FinalOrFutureInt()))
|
||||
args = append(args, "--raise-min-sdk-version")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user