-
Notifications
You must be signed in to change notification settings - Fork 7
/
sepolicy_8_to_13.mk
34 lines (32 loc) · 1.95 KB
/
sepolicy_8_to_13.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# On Android 8.1 and older (< API level 28), BOARD_PLAT_PRIVATE_SEPOLICY_DIR
# is not allowed to hold multiple directories. A build error will occur when
# BOARD_PLAT_PRIVATE_SEPOLICY_DIR is also used by customer/vendor code.
# We work around this by patching system/sepolicy directly.
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28 && echo true),true)
# BOARD_PLAT_PRIVATE_SEPOLICY_DIR
BORT_BOARD_PLAT_PRIVATE_SEPOLICY_DIR := $(BORT_PATH)/sepolicy/private
ifeq (,$(findstring $(BORT_BOARD_PLAT_PRIVATE_SEPOLICY_DIR),$(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)))
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(BORT_BOARD_PLAT_PRIVATE_SEPOLICY_DIR)
endif
BORT_BOARD_PLAT_PRIVATE_VERSION_SEPOLICY_DIR := $(BORT_PATH)/sepolicy/private-$(PLATFORM_SDK_VERSION)
ifneq (,$(wildcard $(BORT_BOARD_PLAT_PRIVATE_VERSION_SEPOLICY_DIR)))
ifeq (,$(findstring $(BORT_BOARD_PLAT_PRIVATE_VERSION_SEPOLICY_DIR),$(BOARD_PLAT_PRIVATE_SEPOLICY_DIR)))
BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(BORT_BOARD_PLAT_PRIVATE_VERSION_SEPOLICY_DIR)
endif
endif
# BOARD_PLAT_PUBLIC_SEPOLICY_DIR
BORT_BOARD_PLAT_PUBLIC_SEPOLICY_DIR := $(BORT_PATH)/sepolicy/public
ifeq (,$(findstring $(BORT_BOARD_PLAT_PUBLIC_SEPOLICY_DIR),$(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)))
BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(BORT_BOARD_PLAT_PUBLIC_SEPOLICY_DIR)
endif
BORT_BOARD_PLAT_PUBLIC_VERSION_SEPOLICY_DIR := $(BORT_PATH)/sepolicy/public-$(PLATFORM_SDK_VERSION)
ifneq (,$(wildcard $(BORT_BOARD_PLAT_PUBLIC_VERSION_SEPOLICY_DIR)))
ifeq (,$(findstring $(BORT_BOARD_PLAT_PUBLIC_VERSION_SEPOLICY_DIR),$(BOARD_PLAT_PUBLIC_SEPOLICY_DIR)))
BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(BORT_BOARD_PLAT_PUBLIC_VERSION_SEPOLICY_DIR)
endif
endif
endif
$(warning BOARD_SEPOLICY_DIRS - $(BOARD_SEPOLICY_DIRS))
$(warning BOARD_SEPOLICY_M4DEFS - $(BORT_BOARD_SEPOLICY_M4DEF))
$(warning BOARD_PLAT_PRIVATE_SEPOLICY_DIR - $(BOARD_PLAT_PRIVATE_SEPOLICY_DIR))
$(warning BOARD_PLAT_PUBLIC_SEPOLICY_DIR - $(BOARD_PLAT_PUBLIC_SEPOLICY_DIR))