Pass shared library updatability attributes as strings
Migrate from ints to Strings so we can pass codenames. Otherwise we can't use these attributes representing a release in progress until that release is finalized. I.e. if release T is in progress, we don't get the correct behaviour if we use "T" in those attributes Bug: 191978330 Test: m nothing Change-Id: I35389da0a01549ba2f820f5e5b78f6ea88c2aea1
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"reflect"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -2551,8 +2550,14 @@ func formattedOptionalSdkLevelAttribute(ctx android.ModuleContext, attrName stri
|
||||
ctx.PropertyErrorf(strings.ReplaceAll(attrName, "-", "_"), err.Error())
|
||||
return ""
|
||||
}
|
||||
intStr := strconv.Itoa(apiLevel.FinalOrPreviewInt())
|
||||
return formattedOptionalAttribute(attrName, &intStr)
|
||||
if apiLevel.IsCurrent() {
|
||||
// passing "current" would always mean a future release, never the current (or the current in
|
||||
// progress) which means some conditions would never be triggered.
|
||||
ctx.PropertyErrorf(strings.ReplaceAll(attrName, "-", "_"),
|
||||
`"current" is not an allowed value for this attribute`)
|
||||
return ""
|
||||
}
|
||||
return formattedOptionalAttribute(attrName, value)
|
||||
}
|
||||
|
||||
// formats an attribute for the xml permissions file if the value is not null
|
||||
|
Reference in New Issue
Block a user