diff options
Diffstat (limited to 'android/config.go')
-rw-r--r-- | android/config.go | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/android/config.go b/android/config.go index 645a263cb..df282ec20 100644 --- a/android/config.go +++ b/android/config.go @@ -197,9 +197,22 @@ func (c Config) ReleaseVersion() string { return c.config.productVariables.ReleaseVersion } -// The flag values files passed to aconfig, derived from RELEASE_VERSION -func (c Config) ReleaseAconfigValueSets() []string { - return c.config.productVariables.ReleaseAconfigValueSets +// The aconfig value set passed to aconfig, derived from RELEASE_VERSION +func (c Config) ReleaseAconfigValueSets() string { + // This logic to handle both Soong module name and bazel target is temporary in order to + // provide backward compatibility where aosp and internal both have the release + // aconfig value set but can't be updated at the same time to use bazel target + value := strings.Split(c.config.productVariables.ReleaseAconfigValueSets, ":") + value_len := len(value) + if value_len > 2 { + // This shouldn't happen as this should be either a module name or a bazel target path. + panic(fmt.Errorf("config file: invalid value for release aconfig value sets: %s", + c.config.productVariables.ReleaseAconfigValueSets)) + } + if value_len > 0 { + return value[value_len-1] + } + return "" } // The flag default permission value passed to aconfig @@ -2060,6 +2073,11 @@ func (c *config) GetApiLibraries() map[string]struct{} { return c.apiLibraries } +// Bp2buildMode indicates whether the config is for bp2build mode of Soong +func (c *config) Bp2buildMode() bool { + return c.BuildMode == Bp2build +} + func (c *deviceConfig) CheckVendorSeappViolations() bool { return Bool(c.config.productVariables.CheckVendorSeappViolations) } |