BOARD_SEPOLICY_DIRS += \
device/samsung_slsi/sepolicy/tee/teegris/vendor
else ifeq ($(BOARD_SEPOLICY_TEE_FLAVOR),mobicore)
+POLICY_TYPE := legacy
+# a device might not set the shipping api level
+# check if its empty to avoid erroring out in the next if
+ifeq ($(PRODUCT_SHIPPING_API_LEVEL),)
+$(warning no product shipping level defined, defaulting to legacy policy)
+# devices launched with oreo or later should be treble
+else ifneq ($(call math_gt_or_eq,$(PRODUCT_SHIPPING_API_LEVEL),26),)
+POLICY_TYPE := treble
+endif
+
+BOARD_SEPOLICY_DIRS += \
+ device/samsung_slsi/sepolicy/tee/mobicore/$(POLICY_TYPE)
+
BOARD_SEPOLICY_DIRS += \
- device/samsung_slsi/sepolicy/tee/mobicore
+ device/samsung_slsi/sepolicy/tee/mobicore/common
endif
--- /dev/null
+type mobicore_vendor_data_file, file_type, data_file_type;
+type mobicore_data_file, file_type, core_data_file_type, data_file_type;
--- /dev/null
+/dev/mobicore u:object_r:tee_device:s0
+/dev/mobicore-user u:object_r:tee_device:s0
+/dev/t-base-tui u:object_r:tee_device:s0
--- /dev/null
+# /dev/mobicore-user
+allow hal_fingerprint_default tee_device:chr_file rw_file_perms;
--- /dev/null
+# /dev/mobicore-user
+allow hal_gatekeeper_default tee_device:chr_file rw_file_perms;
--- /dev/null
+get_prop(hal_keymaster_default, tee_prop)
--- /dev/null
+type tee_prop, property_type;
--- /dev/null
+allow tee efs_file:dir { search getattr };
+allow tee efs_file:file r_file_perms;
+allow tee gatekeeper_efs_file:dir r_dir_perms;
+allow tee gatekeeper_efs_file:file r_file_perms;
+allow tee init:unix_stream_socket connectto;
+allow tee property_socket:sock_file write;
+allow tee prov_efs_file:dir search;
+
+set_prop(tee, tee_prop)
+
+# /dev/t-base-tui
+allow tee tee_device:chr_file r_file_perms;
+
+allow tee mobicore_vendor_data_file:dir r_dir_perms;
+allow tee mobicore_vendor_data_file:file rw_file_perms;
+++ /dev/null
-type mobicore_vendor_data_file, file_type, data_file_type;
-type mobicore_data_file, file_type, core_data_file_type, data_file_type;
+++ /dev/null
-/dev/mobicore u:object_r:tee_device:s0
-/dev/mobicore-user u:object_r:tee_device:s0
-/dev/t-base-tui u:object_r:tee_device:s0
+++ /dev/null
-# /dev/mobicore-user
-allow hal_fingerprint_default tee_device:chr_file rw_file_perms;
+++ /dev/null
-# /dev/mobicore-user
-allow hal_gatekeeper_default tee_device:chr_file rw_file_perms;
+++ /dev/null
-get_prop(hal_keymaster_default, tee_prop)
+++ /dev/null
-# /dev/mobicore, /dev/t-base-tui
-allow init tee_device:chr_file rw_file_perms;
--- /dev/null
+# /dev/mobicore, /dev/t-base-tui
+allow init tee_device:chr_file rw_file_perms;
--- /dev/null
+sys.mobicoredaemon.enable u:object_r:tee_prop:s0
--- /dev/null
+set_prop(tee, system_prop)
--- /dev/null
+allow vendor_init mobicore_data_file:dir setattr;
+++ /dev/null
-type tee_prop, property_type;
+++ /dev/null
-sys.mobicoredaemon.enable u:object_r:tee_prop:s0
+++ /dev/null
-allow tee efs_file:dir { search getattr };
-allow tee efs_file:file r_file_perms;
-allow tee gatekeeper_efs_file:dir r_dir_perms;
-allow tee gatekeeper_efs_file:file r_file_perms;
-allow tee init:unix_stream_socket connectto;
-allow tee property_socket:sock_file write;
-allow tee prov_efs_file:dir search;
-allow tee system_prop:property_service set;
-allow tee tee_prop:property_service set;
-
-# /dev/t-base-tui
-allow tee tee_device:chr_file r_file_perms;
-
-allow tee mobicore_vendor_data_file:dir r_dir_perms;
-allow tee mobicore_vendor_data_file:file rw_file_perms;
--- /dev/null
+vendor.sys.mobicoredaemon.enable u:object_r:tee_prop:s0
+++ /dev/null
-allow vendor_init mobicore_data_file:dir setattr;