blob: baf26c35d9128ae61d712d4d54a44216d7515b0f [file] [log] [blame]
Inseob Kim085f22f2023-11-09 11:13:01 +09001####################################
2# is_flag_enabled(flag, rules)
3# SELinux rules which apply only if given feature is turned on
Inseob Kim9868a0c2023-11-17 18:02:25 +09004define(`is_flag_enabled', `ifelse(target_flag_$1, `true', `$2')')
Inseob Kim085f22f2023-11-09 11:13:01 +09005
6####################################
7# is_flag_disabled(flag, rules)
8# SELinux rules which apply only if given feature is turned off
Inseob Kim9868a0c2023-11-17 18:02:25 +09009define(`is_flag_disabled', `ifelse(target_flag_$1, `true', , `$2')')
Inseob Kim8697fc82024-04-16 14:45:32 +090010
11####################################
Vadim Caen5e584fc2024-09-02 13:51:48 +000012# starting_at_board_api(api_level, rules)
Inseob Kim8697fc82024-04-16 14:45:32 +090013#
Vadim Caen5e584fc2024-09-02 13:51:48 +000014# 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.
Inseob Kim8697fc82024-04-16 14:45:32 +090024define(`starting_at_board_api', `ifelse(eval(target_board_api_level >= $1), 1, `$2')')