• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1####################################
2# is_flag_enabled(flag, rules)
3# SELinux rules which apply only if given feature is turned on
4define(`is_flag_enabled', `ifelse(target_flag_$1, `true', `$2')')
5
6####################################
7# is_flag_disabled(flag, rules)
8# SELinux rules which apply only if given feature is turned off
9define(`is_flag_disabled', `ifelse(target_flag_$1, `true', , `$2')')
10
11####################################
12# starting_at_board_api(api_level, rules)
13#
14# This macro conditionally exposes SELinux rules within system/sepolicy/public,
15# ensuring they are available to vendors only when the board API level is at or
16# above the specified 'api_level'.
17#
18# * Platform sepolicy: Rules are always enabled, regardless of API level.
19# * Vendor sepolicy: Rules are enabled only when the board API level meets or
20#                    exceeds the value provided in 'api_level'.
21#
22# Apply this macro to public types and attributes (in system/sepolicy/public) to
23# restrict vendor access based on board API level.
24define(`starting_at_board_api', `ifelse(eval(target_board_api_level >= $1), 1, `$2')')
25