diff --git a/java/sdk_library.go b/java/sdk_library.go index f7e5d9d40..490c03132 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -2700,7 +2700,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