blob: 510b856ff8e03ffd8fc362794187b63beca63757 [file] [log] [blame]
Biswajit Paul76db2352016-04-20 15:53:02 -07001# 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
sb6596d4aaecb2018-12-01 08:15:34 +000028allow cameraserver camera_data_file:dir search;
Biswajit Paul76db2352016-04-20 15:53:02 -070029allow cameraserver camera_data_file:sock_file write;
30allow cameraserver gpu_device:chr_file rw_file_perms;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053031#allow cameraserver mm-qcamerad:unix_dgram_socket sendto;
Mukund Mittald317a152017-07-03 15:59:55 +053032#changes to access laser device
33r_dir_file(cameraserver, input_device);
Ravi Kumar Siddojigari54a727d2016-05-26 19:02:15 +053034
Varun Gargb33f9312017-07-24 15:07:35 +053035#interaction with thermal sockets
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053036#unix_socket_connect(cameraserver, thermal, thermal-engine)
Ravi Kumar Siddojigari54a727d2016-05-26 19:02:15 +053037
38#Allow surfaceflinger access for camera preview
39allow cameraserver surfaceflinger:unix_stream_socket { read write };
Mridul Singh1194edc2016-03-28 12:16:07 -070040
41# allow cameraserver to communicate with sensors
42allow cameraserver sensors_device:chr_file rw_file_perms;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053043#unix_socket_connect(cameraserver, sensors, sensors);
Mridul Singh1194edc2016-03-28 12:16:07 -070044allow cameraserver system_server:unix_stream_socket { read write };
Biswajit Paul7adcb732016-08-05 17:39:55 -070045
46#Allow read access to soc/msm-cam/video4linux/video0/name sysfs
47allow cameraserver sysfs:file r_file_perms;
Mridul Singhae1afdd2016-08-23 13:47:10 -070048
49allow cameraserver persist_file:dir r_dir_perms;
sahil madekaa3608c92017-05-12 15:41:40 -070050set_prop(cameraserver, camera_prop)
Biswajit Paul2d35d982017-02-01 17:40:10 -080051allow cameraserver self:socket create_socket_perms_no_ioctl;
Mridul Singhae1afdd2016-08-23 13:47:10 -070052allow cameraserver sensors_persist_file:dir r_dir_perms;
53allow cameraserver sensors_persist_file:file r_file_perms;
54allow cameraserver graphics_device:dir r_dir_perms;
55allow cameraserver sensorservice_service:service_manager find;
Mridul Singh86a144a2016-09-12 15:23:29 -070056allow cameraserver system_file:dir r_dir_perms;
Mridul Singh9529c0d2016-09-12 22:01:15 +053057
58#Allows camera to call ADSP QDSP6 functionality
59allow cameraserver qdsp_device:chr_file r_file_perms;
Biswajit Paulf63bd142017-03-16 16:41:02 -070060allow cameraserver camera_prop:file r_file_perms;
Biswajit Paul700ef6a2017-03-31 11:22:34 -070061
Senthil Kumar Rajagopalee779892016-12-23 11:38:03 +053062#allow cameraserver to access /dsp
63r_dir_file(cameraserver, adsprpcd_file);
64
Ravi Kumar Siddojigariecc80d72017-06-14 22:08:15 +053065#need this in full_treble for camera perview
66allow cameraserver hal_allocator:fd use;
67
Santhosh Kumar Thimmanna Bhattarc1fa6942017-08-31 20:06:45 +053068#Allow camera to use mediacodec binder calls
69allow cameraserver mediacodec:binder call;
70
Biswajit Paul700ef6a2017-03-31 11:22:34 -070071# added now for camcorder functionality. need to use HIDL
72userdebug_or_eng(`
73binder_call(cameraserver, hal_graphics_composer)
74')