Merge changes from topic "revert-2925209-KVPWEBRQHT" into main

* changes:
  Revert "Convert AFDO mutators to TransitionMutator"
  Revert "Remove fdoProfileMutator"
This commit is contained in:
Ke-Yu Lu
2024-02-06 05:46:07 +00:00
committed by Gerrit Code Review
6 changed files with 167 additions and 81 deletions

View File

@@ -1493,18 +1493,18 @@ func (c *deviceConfig) PgoAdditionalProfileDirs() []string {
}
// AfdoProfile returns fully qualified path associated to the given module name
func (c *deviceConfig) AfdoProfile(name string) (string, error) {
func (c *deviceConfig) AfdoProfile(name string) (*string, error) {
for _, afdoProfile := range c.config.productVariables.AfdoProfiles {
split := strings.Split(afdoProfile, ":")
if len(split) != 3 {
return "", fmt.Errorf("AFDO_PROFILES has invalid value: %s. "+
return nil, fmt.Errorf("AFDO_PROFILES has invalid value: %s. "+
"The expected format is <module>:<fully-qualified-path-to-fdo_profile>", afdoProfile)
}
if split[0] == name {
return strings.Join([]string{split[1], split[2]}, ":"), nil
return proptools.StringPtr(strings.Join([]string{split[1], split[2]}, ":")), nil
}
}
return "", nil
return nil, nil
}
func (c *deviceConfig) VendorSepolicyDirs() []string {