Accept starting_at_board_api macro in service contexts
The macro requires the property target_board_api_level to be set.
Similary to policyConf, add a property to selinuxContext.
Bug: 367249722
Test: build with a call to starting_at_board_api in service_contexts.
Change-Id: I9b4b975a926a41f49138ca78c36b91310f57b586
diff --git a/build/soong/policy.go b/build/soong/policy.go
index d490845..8bdf01b 100644
--- a/build/soong/policy.go
+++ b/build/soong/policy.go
@@ -224,15 +224,6 @@
return proptools.IntDefault(c.properties.Mls_cats, MlsCats)
}
-func (c *policyConf) boardApiLevel(ctx android.ModuleContext) string {
- level := proptools.StringDefault(c.properties.Board_api_level, "current")
- if level == "current" {
- return ctx.Config().VendorApiLevel()
- } else {
- return level
- }
-}
-
func findPolicyConfOrder(name string) int {
for idx, pattern := range policyConfOrder {
// We could use regexp but it seems like an overkill
@@ -274,7 +265,7 @@
FlagWithArg("-D target_requires_insecure_execmem_for_swiftshader=", strconv.FormatBool(ctx.DeviceConfig().RequiresInsecureExecmemForSwiftshader())).
FlagWithArg("-D target_enforce_debugfs_restriction=", c.enforceDebugfsRestrictions(ctx)).
FlagWithArg("-D target_recovery=", strconv.FormatBool(c.isTargetRecovery())).
- FlagWithArg("-D target_board_api_level=", c.boardApiLevel(ctx)).
+ Flag(boardApiLevelToM4Macro(ctx, c.properties.Board_api_level)).
Flags(flagsToM4Macros(flags)).
Flag("-s").
Inputs(srcs).