blob: 44cd33a5b3e1c74433e54d9498cb611afb1a0c27 [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 Caend90d5ce2024-08-19 15:08:35 +020012# starting_at_board_api(api_level, rules_if_api_level)
Inseob Kim8697fc82024-04-16 14:45:32 +090013#
Vadim Caend90d5ce2024-08-19 15:08:35 +020014# This macro conditionally exposes SELinux rules ensuring they are available
15# only when the board API level is at or above the specified 'api_level'.
Inseob Kim8697fc82024-04-16 14:45:32 +090016define(`starting_at_board_api', `ifelse(eval(target_board_api_level >= $1), 1, `$2')')
Vadim Caend90d5ce2024-08-19 15:08:35 +020017
18####################################
19# until_board_api(api_level, rules_if_lower_api_level)
20#
21# This macro conditionally exposes SELinux rules ensuring they are available
22# only when the board API level is below the specified 'api_level'.
23define(`until_board_api', `ifelse(eval(target_board_api_level < $1), 1, `$2')')