Biswajit Paul | 76db235 | 2016-04-20 15:53:02 -0700 | [diff] [blame] | 1 | # Copyright (c) 2016, 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 | |
sb6596 | d4aaecb | 2018-12-01 08:15:34 +0000 | [diff] [blame] | 28 | allow cameraserver camera_data_file:dir search; |
Biswajit Paul | 76db235 | 2016-04-20 15:53:02 -0700 | [diff] [blame] | 29 | allow cameraserver camera_data_file:sock_file write; |
| 30 | allow cameraserver gpu_device:chr_file rw_file_perms; |
Ravi Kumar Siddojigari | c7def12 | 2017-06-13 00:49:19 +0530 | [diff] [blame] | 31 | #allow cameraserver mm-qcamerad:unix_dgram_socket sendto; |
Mukund Mittal | d317a15 | 2017-07-03 15:59:55 +0530 | [diff] [blame] | 32 | #changes to access laser device |
| 33 | r_dir_file(cameraserver, input_device); |
Ravi Kumar Siddojigari | 54a727d | 2016-05-26 19:02:15 +0530 | [diff] [blame] | 34 | |
Varun Garg | b33f931 | 2017-07-24 15:07:35 +0530 | [diff] [blame] | 35 | #interaction with thermal sockets |
Ravi Kumar Siddojigari | c7def12 | 2017-06-13 00:49:19 +0530 | [diff] [blame] | 36 | #unix_socket_connect(cameraserver, thermal, thermal-engine) |
Ravi Kumar Siddojigari | 54a727d | 2016-05-26 19:02:15 +0530 | [diff] [blame] | 37 | |
| 38 | #Allow surfaceflinger access for camera preview |
| 39 | allow cameraserver surfaceflinger:unix_stream_socket { read write }; |
Mridul Singh | 1194edc | 2016-03-28 12:16:07 -0700 | [diff] [blame] | 40 | |
| 41 | # allow cameraserver to communicate with sensors |
| 42 | allow cameraserver sensors_device:chr_file rw_file_perms; |
Ravi Kumar Siddojigari | c7def12 | 2017-06-13 00:49:19 +0530 | [diff] [blame] | 43 | #unix_socket_connect(cameraserver, sensors, sensors); |
Mridul Singh | 1194edc | 2016-03-28 12:16:07 -0700 | [diff] [blame] | 44 | allow cameraserver system_server:unix_stream_socket { read write }; |
Biswajit Paul | 7adcb73 | 2016-08-05 17:39:55 -0700 | [diff] [blame] | 45 | |
| 46 | #Allow read access to soc/msm-cam/video4linux/video0/name sysfs |
| 47 | allow cameraserver sysfs:file r_file_perms; |
Mridul Singh | ae1afdd | 2016-08-23 13:47:10 -0700 | [diff] [blame] | 48 | |
| 49 | allow cameraserver persist_file:dir r_dir_perms; |
sahil madeka | a3608c9 | 2017-05-12 15:41:40 -0700 | [diff] [blame] | 50 | set_prop(cameraserver, camera_prop) |
Biswajit Paul | 2d35d98 | 2017-02-01 17:40:10 -0800 | [diff] [blame] | 51 | allow cameraserver self:socket create_socket_perms_no_ioctl; |
Mridul Singh | ae1afdd | 2016-08-23 13:47:10 -0700 | [diff] [blame] | 52 | allow cameraserver sensors_persist_file:dir r_dir_perms; |
| 53 | allow cameraserver sensors_persist_file:file r_file_perms; |
| 54 | allow cameraserver graphics_device:dir r_dir_perms; |
| 55 | allow cameraserver sensorservice_service:service_manager find; |
Mridul Singh | 86a144a | 2016-09-12 15:23:29 -0700 | [diff] [blame] | 56 | allow cameraserver system_file:dir r_dir_perms; |
Mridul Singh | 9529c0d | 2016-09-12 22:01:15 +0530 | [diff] [blame] | 57 | |
| 58 | #Allows camera to call ADSP QDSP6 functionality |
| 59 | allow cameraserver qdsp_device:chr_file r_file_perms; |
Biswajit Paul | f63bd14 | 2017-03-16 16:41:02 -0700 | [diff] [blame] | 60 | allow cameraserver camera_prop:file r_file_perms; |
Biswajit Paul | 700ef6a | 2017-03-31 11:22:34 -0700 | [diff] [blame] | 61 | |
Senthil Kumar Rajagopal | ee77989 | 2016-12-23 11:38:03 +0530 | [diff] [blame] | 62 | #allow cameraserver to access /dsp |
| 63 | r_dir_file(cameraserver, adsprpcd_file); |
| 64 | |
Ravi Kumar Siddojigari | ecc80d7 | 2017-06-14 22:08:15 +0530 | [diff] [blame] | 65 | #need this in full_treble for camera perview |
| 66 | allow cameraserver hal_allocator:fd use; |
| 67 | |
Santhosh Kumar Thimmanna Bhattar | c1fa694 | 2017-08-31 20:06:45 +0530 | [diff] [blame] | 68 | #Allow camera to use mediacodec binder calls |
| 69 | allow cameraserver mediacodec:binder call; |
| 70 | |
Biswajit Paul | 700ef6a | 2017-03-31 11:22:34 -0700 | [diff] [blame] | 71 | # added now for camcorder functionality. need to use HIDL |
| 72 | userdebug_or_eng(` |
| 73 | binder_call(cameraserver, hal_graphics_composer) |
| 74 | ') |