From 489912283e29c4ee07754b185e984eddd90fb067 Mon Sep 17 00:00:00 2001 From: Pedro Loureiro Date: Fri, 17 Jun 2022 20:01:21 +0000 Subject: [PATCH] Translate SDK codenames to SDK versions for finalized releases This applies to updatability attributes of shared libraries. Bug: 235318264 Test: atest UpdatableSharedLibsTest Change-Id: Id2c2b769a99ca1debb5d8525e46d37698ef2fc6c --- java/sdk_library.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/sdk_library.go b/java/sdk_library.go index cd8e8755e..47ffc6afc 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -2584,7 +2584,10 @@ func formattedOptionalSdkLevelAttribute(ctx android.ModuleContext, attrName stri `"current" is not an allowed value for this attribute`) return "" } - return formattedOptionalAttribute(attrName, value) + // "safeValue" is safe because it translates finalized codenames to a string + // with their SDK int. + safeValue := apiLevel.String() + return formattedOptionalAttribute(attrName, &safeValue) } // formats an attribute for the xml permissions file if the value is not null