blob: 91ed32bbe43ba8a0d5277082ca21d30d1ba6f5e8 [file] [log] [blame]
Mohan Pallaka58636a92014-11-14 14:41:22 -08001# Policies for hbtp (host based touch processing)
Biswajit Paul6786a922017-03-16 11:53:53 -07002type hbtp, domain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +05303type hbtp_exec, exec_type, vendor_file_type, file_type;
Mohan Pallaka58636a92014-11-14 14:41:22 -08004init_daemon_domain(hbtp)
Alex Sarrafb6087f52017-06-01 15:47:17 -07005hal_server_domain(hbtp, hal_hbtp)
Mohan Pallaka58636a92014-11-14 14:41:22 -08006# Allow access for /dev/hbtp_input and /dev/jdi-bu21150
Alex Sarrafc0f45a22016-08-30 12:53:17 -07007allow hbtp { hbtp_device qdsp_device dsp_device bu21150_device }:chr_file rw_file_perms;
Mohan Pallakab4053ef2014-11-25 14:01:29 -08008
9allow hbtp hbtp_log_file:dir rw_dir_perms;
10allow hbtp hbtp_log_file:file create_file_perms;
11
Alex Sarraf1e9cbb42017-05-25 15:01:58 -070012allow hbtp hbtp_cfg_file:dir r_dir_perms;
13allow hbtp hbtp_cfg_file:file r_file_perms;
14
Alex Sarrafbce131c2017-05-19 14:02:27 -070015allow hbtp firmware_file:dir r_dir_perms;
16allow hbtp firmware_file:file r_file_perms;
17
Alex Sarraf339cfb12017-06-07 17:16:47 -070018allow hbtp sysfs_usb_supply:file r_file_perms;
19allow hbtp sysfs_usb_supply:dir r_dir_perms;
Alex Sarrafe9d3a5e2015-09-29 21:50:15 -070020
Shantanu Jainf0a9cd82016-06-29 11:55:47 +053021allow hbtp hbtp_kernel_sysfs:file rw_file_perms;
22
Alex Sarraf339cfb12017-06-07 17:16:47 -070023allow hbtp sysfs_graphics:file r_file_perms;
24allow hbtp sysfs_graphics:dir r_dir_perms;
25
26allow hbtp sysfs_battery_supply:file r_file_perms;
27allow hbtp sysfs_battery_supply:dir r_dir_perms;
Alex Sarraf212502d2017-05-04 17:33:19 -070028
29allow hbtp ion_device:chr_file r_file_perms;
Alex Sarrafe9d3a5e2015-09-29 21:50:15 -070030
Mohan Pallakab4053ef2014-11-25 14:01:29 -080031allow hbtp self:netlink_kobject_uevent_socket { create read setopt bind };
32
Alex Sarrafe9d3a5e2015-09-29 21:50:15 -070033# Allow the service to access wakelock sysfs
34allow hbtp sysfs_wake_lock:file r_file_perms;
35
Mohan Pallakac8036c82017-09-20 11:13:19 -070036# Allow the service to change to system from root and have sys_nice capability
37allow hbtp self:capability { setgid setuid sys_nice };
Alex Sarrafe9d3a5e2015-09-29 21:50:15 -070038
Alex Sarraf27e26422015-12-04 11:56:47 -080039# Allow load touch driver as touchPD
40r_dir_file(hbtp, adsprpcd_file)
41
Alex Sarrafe9d3a5e2015-09-29 21:50:15 -070042# Allow the service to access wakelock capability
43wakelock_use(hbtp)
Alex Sarrafb6087f52017-06-01 15:47:17 -070044
45# Allow hwbinder call from hal client to server and vice-versa
46binder_call(hal_hbtp_client, hal_hbtp_server)
47binder_call(hal_hbtp_server, hal_hbtp_client)
48
49# Allow hwservice related rules
50add_hwservice(hal_hbtp_server, hal_hbtp_hwservice)
51allow hal_hbtp_client hal_hbtp_hwservice:hwservice_manager find;
52hal_client_domain(hbtp, hal_allocator);