summaryrefslogtreecommitdiffstats
path: root/r_non_plat/mtk_hal_mms.te
blob: d52f12bb5232eabc79285aa8e1f1ffc327f02817 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ==============================================
# Policy File of /vendor/bin/hw/vendor.mediatek.hardware.mms@1.0-service Executable File

# ==============================================
# Type Declaration
# ==============================================

type mtk_hal_mms, domain;
type mtk_hal_mms_exec, exec_type, file_type, vendor_file_type;

# ==============================================
# MTK Policy Rule
# ==============================================

# Setup for domain transition
init_daemon_domain(mtk_hal_mms)

# Allow to use HWBinder IPC
hwbinder_use(mtk_hal_mms);

# Allow a set of permissions required for a domain to be a server which provides a HAL implementation over HWBinder.
hal_server_domain(mtk_hal_mms, hal_mms)

# add/find permission rule to hwservicemanager
add_hwservice(hal_mms_server, mtk_hal_mms_hwservice)

# Purpose : Allow to use kernel driver
allow mtk_hal_mms graphics_device:chr_file { read write open ioctl };
allow mtk_hal_mms ion_device:chr_file { read open ioctl };
allow mtk_hal_mms mtk_cmdq_device:chr_file { read open ioctl };
allow mtk_hal_mms mtk_mdp_device:chr_file rw_file_perms;
allow mtk_hal_mms sw_sync_device:chr_file rw_file_perms;
allow mtk_hal_mms mtk_hal_pq_hwservice:hwservice_manager find;
allow mtk_hal_mms proc:file r_file_perms;

# Purpose : Allow to use allocator for JPEG
hal_client_domain(mtk_hal_mms, hal_allocator)
allow mtk_hal_mms mtk_hal_pq:binder call;

# Purpose : Allow to use graphics allocator fd for gralloc_extra
allow mtk_hal_mms hal_graphics_allocator_default:fd use;
allow mtk_hal_mms debugfs_ion:dir search;
allow mtk_hal_mms merged_hal_service:fd use;

# Purpose : VDEC/VENC device node
allow mtk_hal_mms Vcodec_device:chr_file rw_file_perms;
allow mtk_hal_mms proc_mtk_jpeg:file r_file_perms;
allowxperm mtk_hal_mms proc_mtk_jpeg:file ioctl {
     JPG_BRIDGE_ENC_IO_INIT
     JPG_BRIDGE_ENC_IO_CONFIG
     JPG_BRIDGE_ENC_IO_WAIT
     JPG_BRIDGE_ENC_IO_DEINIT
     JPG_BRIDGE_ENC_IO_START
     };
# Allow to use mms by JPEG with handle
allow mtk_hal_mms platform_app:fd use;