Biswajit Paul | 28439f9 | 2015-07-15 13:28:27 -0700 | [diff] [blame] | 1 | # Copyright (c) 2015, The Linux Foundation. All rights reserved. |
| 2 | # |
| 3 | # Redistribution and use in source and binary forms, with or without |
| 4 | # modification, are permitted provided that the following conditions are |
| 5 | # met: |
| 6 | # * Redistributions of source code must retain the above copyright |
| 7 | # notice, this list of conditions and the following disclaimer. |
| 8 | # * Redistributions in binary form must reproduce the above |
| 9 | # copyright notice, this list of conditions and the following |
| 10 | # disclaimer in the documentation and/or other materials provided |
| 11 | # with the distribution. |
| 12 | # * Neither the name of The Linux Foundation nor the names of its |
| 13 | # contributors may be used to endorse or promote products derived |
| 14 | # from this software without specific prior written permission. |
| 15 | # |
| 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #qfp daemon for ultrasonic fingerprint sensor |
| 29 | type qfp-daemon, domain; |
| 30 | type qfp-daemon_exec, exec_type, file_type; |
| 31 | |
| 32 | net_domain(qfp-daemon) |
| 33 | init_daemon_domain(qfp-daemon) |
| 34 | |
| 35 | binder_call(qfp-daemon, servicemanager) |
| 36 | binder_call(qfp-daemon, system_app) |
Avijit Kanti Das | 8469d2c | 2015-09-18 07:55:17 -0700 | [diff] [blame] | 37 | binder_call(qfp-daemon, fingerprintd) |
Biswajit Paul | 28439f9 | 2015-07-15 13:28:27 -0700 | [diff] [blame] | 38 | binder_use(qfp-daemon) |
| 39 | |
| 40 | allow qfp-daemon qfp-daemon_data_file:dir { rw_dir_perms setattr }; |
| 41 | allow qfp-daemon qfp-daemon_data_file:file create_file_perms; |
| 42 | |
| 43 | # Access to tee_device |
| 44 | allow qfp-daemon tee_device:chr_file rw_file_perms; |
| 45 | |
Lior Barenboim | d9799ca | 2016-05-06 11:11:52 -0700 | [diff] [blame] | 46 | # Access QFP Android Proxy |
| 47 | allow qfp-daemon qfp_proxy_service:service_manager find; |
| 48 | |
Biswajit Paul | 28439f9 | 2015-07-15 13:28:27 -0700 | [diff] [blame] | 49 | # Add IQfpService service |
| 50 | allow qfp-daemon iqfp_service:service_manager add; |
| 51 | |
| 52 | # Read system property |
| 53 | allow qfp-daemon property_socket:sock_file write; |
| 54 | |
| 55 | # RW to device driver |
Amal Paul | 6f62170 | 2015-07-19 22:43:13 -0700 | [diff] [blame] | 56 | allow qfp-daemon qbt1000_device:chr_file rw_file_perms; |
Biswajit Paul | 28439f9 | 2015-07-15 13:28:27 -0700 | [diff] [blame] | 57 | |
| 58 | # R dir perms for firmware dir |
| 59 | r_dir_file(qfp-daemon, firmware_file) |
Lior Barenboim | 7775424 | 2015-08-25 09:34:05 +0300 | [diff] [blame] | 60 | |
Steve Kondik | 1ae3df4 | 2016-05-19 21:45:22 -0700 | [diff] [blame] | 61 | # R dir perms for persist qc_senseid dir |
| 62 | r_dir_file(qfp-daemon, persist_file) |
| 63 | r_dir_file(qfp-daemon, persist_qc_senseid_file) |
| 64 | |
Lior Barenboim | 7775424 | 2015-08-25 09:34:05 +0300 | [diff] [blame] | 65 | # Allow qfp daemon access to system server |
| 66 | binder_call(qfp-daemon, system_server); |
| 67 | |
| 68 | # Allow read to sensor device and read/write to sensor socket |
| 69 | allow qfp-daemon sensors_device:chr_file r_file_perms; |
| 70 | allow qfp-daemon sensors_socket:sock_file rw_file_perms; |
| 71 | allow qfp-daemon sensors:unix_stream_socket connectto; |
Lior Barenboim | ffc507b | 2015-10-07 13:40:08 +0300 | [diff] [blame] | 72 | |
| 73 | # Allow listing input devices and sending input events |
| 74 | allow qfp-daemon input_device:chr_file rw_file_perms; |
| 75 | allow qfp-daemon input_device:dir r_dir_perms; |