From 2669e7edf00ccce9a264381140d51cd4f22b429e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 5 Mar 2021 11:51:56 -0800 Subject: [PATCH] Exempt framework-res from UseApiFingerprint Generating the API fingerpring depends on framework-res, so the fingerprint cannot be embedded into framework-res. Hardcode an exemption to UseApiFingerprint. Bug: 181978889 Test: TARGET_BUILD_VARIANT=user UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true vendor/google/build/build_mainline_modules.sh Change-Id: I621f36d5eb157dd97baa132ff109b4df791eedcc --- java/android_manifest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/android_manifest.go b/java/android_manifest.go index c76bb2fda..b30f3d2c8 100644 --- a/java/android_manifest.go +++ b/java/android_manifest.go @@ -91,7 +91,7 @@ func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext if err != nil { ctx.ModuleErrorf("invalid targetSdkVersion: %s", err) } - if UseApiFingerprint(ctx) { + if UseApiFingerprint(ctx) && ctx.ModuleName() != "framework-res" { targetSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", ApiFingerprintPath(ctx).String()) deps = append(deps, ApiFingerprintPath(ctx)) } @@ -100,7 +100,7 @@ func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext if err != nil { ctx.ModuleErrorf("invalid minSdkVersion: %s", err) } - if UseApiFingerprint(ctx) { + if UseApiFingerprint(ctx) && ctx.ModuleName() != "framework-res" { minSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", ApiFingerprintPath(ctx).String()) deps = append(deps, ApiFingerprintPath(ctx)) }