Mohan Pallaka | 58636a9 | 2014-11-14 14:41:22 -0800 | [diff] [blame] | 1 | # Policies for hbtp (host based touch processing) |
Biswajit Paul | 6786a92 | 2017-03-16 11:53:53 -0700 | [diff] [blame] | 2 | type hbtp, domain; |
Ravi Kumar Siddojigari | c7def12 | 2017-06-13 00:49:19 +0530 | [diff] [blame] | 3 | type hbtp_exec, exec_type, vendor_file_type, file_type; |
Mohan Pallaka | 58636a9 | 2014-11-14 14:41:22 -0800 | [diff] [blame] | 4 | init_daemon_domain(hbtp) |
Alex Sarraf | b6087f5 | 2017-06-01 15:47:17 -0700 | [diff] [blame] | 5 | hal_server_domain(hbtp, hal_hbtp) |
Mohan Pallaka | 58636a9 | 2014-11-14 14:41:22 -0800 | [diff] [blame] | 6 | # Allow access for /dev/hbtp_input and /dev/jdi-bu21150 |
Alex Sarraf | c0f45a2 | 2016-08-30 12:53:17 -0700 | [diff] [blame] | 7 | allow hbtp { hbtp_device qdsp_device dsp_device bu21150_device }:chr_file rw_file_perms; |
Mohan Pallaka | b4053ef | 2014-11-25 14:01:29 -0800 | [diff] [blame] | 8 | |
| 9 | allow hbtp hbtp_log_file:dir rw_dir_perms; |
| 10 | allow hbtp hbtp_log_file:file create_file_perms; |
| 11 | |
Alex Sarraf | 1e9cbb4 | 2017-05-25 15:01:58 -0700 | [diff] [blame] | 12 | allow hbtp hbtp_cfg_file:dir r_dir_perms; |
| 13 | allow hbtp hbtp_cfg_file:file r_file_perms; |
| 14 | |
Alex Sarraf | bce131c | 2017-05-19 14:02:27 -0700 | [diff] [blame] | 15 | allow hbtp firmware_file:dir r_dir_perms; |
| 16 | allow hbtp firmware_file:file r_file_perms; |
| 17 | |
Alex Sarraf | 339cfb1 | 2017-06-07 17:16:47 -0700 | [diff] [blame] | 18 | allow hbtp sysfs_usb_supply:file r_file_perms; |
| 19 | allow hbtp sysfs_usb_supply:dir r_dir_perms; |
Alex Sarraf | e9d3a5e | 2015-09-29 21:50:15 -0700 | [diff] [blame] | 20 | |
Shantanu Jain | f0a9cd8 | 2016-06-29 11:55:47 +0530 | [diff] [blame] | 21 | allow hbtp hbtp_kernel_sysfs:file rw_file_perms; |
| 22 | |
Alex Sarraf | 339cfb1 | 2017-06-07 17:16:47 -0700 | [diff] [blame] | 23 | allow hbtp sysfs_graphics:file r_file_perms; |
| 24 | allow hbtp sysfs_graphics:dir r_dir_perms; |
| 25 | |
| 26 | allow hbtp sysfs_battery_supply:file r_file_perms; |
| 27 | allow hbtp sysfs_battery_supply:dir r_dir_perms; |
Alex Sarraf | 212502d | 2017-05-04 17:33:19 -0700 | [diff] [blame] | 28 | |
| 29 | allow hbtp ion_device:chr_file r_file_perms; |
Alex Sarraf | e9d3a5e | 2015-09-29 21:50:15 -0700 | [diff] [blame] | 30 | |
Mohan Pallaka | b4053ef | 2014-11-25 14:01:29 -0800 | [diff] [blame] | 31 | allow hbtp self:netlink_kobject_uevent_socket { create read setopt bind }; |
| 32 | |
Alex Sarraf | e9d3a5e | 2015-09-29 21:50:15 -0700 | [diff] [blame] | 33 | # Allow the service to access wakelock sysfs |
| 34 | allow hbtp sysfs_wake_lock:file r_file_perms; |
| 35 | |
Mohan Pallaka | c8036c8 | 2017-09-20 11:13:19 -0700 | [diff] [blame] | 36 | # Allow the service to change to system from root and have sys_nice capability |
| 37 | allow hbtp self:capability { setgid setuid sys_nice }; |
Alex Sarraf | e9d3a5e | 2015-09-29 21:50:15 -0700 | [diff] [blame] | 38 | |
Alex Sarraf | 27e2642 | 2015-12-04 11:56:47 -0800 | [diff] [blame] | 39 | # Allow load touch driver as touchPD |
| 40 | r_dir_file(hbtp, adsprpcd_file) |
| 41 | |
Alex Sarraf | e9d3a5e | 2015-09-29 21:50:15 -0700 | [diff] [blame] | 42 | # Allow the service to access wakelock capability |
| 43 | wakelock_use(hbtp) |
Alex Sarraf | b6087f5 | 2017-06-01 15:47:17 -0700 | [diff] [blame] | 44 | |
| 45 | # Allow hwbinder call from hal client to server and vice-versa |
| 46 | binder_call(hal_hbtp_client, hal_hbtp_server) |
| 47 | binder_call(hal_hbtp_server, hal_hbtp_client) |
| 48 | |
| 49 | # Allow hwservice related rules |
| 50 | add_hwservice(hal_hbtp_server, hal_hbtp_hwservice) |
| 51 | allow hal_hbtp_client hal_hbtp_hwservice:hwservice_manager find; |
| 52 | hal_client_domain(hbtp, hal_allocator); |