Aalique Grahame | ba7af8c | 2017-12-06 20:52:21 -0800 | [diff] [blame] | 1 | # Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. |
Sharad Sangle | c2a6afd | 2016-06-30 17:17:38 +0530 | [diff] [blame] | 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. |
Gao Jie | 269e947 | 2016-09-19 10:39:58 +0800 | [diff] [blame] | 27 | # |
| 28 | # Copyright (c) 2015-2016 Dolby Laboratories, Inc. All rights reserved. |
| 29 | # |
| 30 | # Redistribution and use in source and binary forms, with or without |
| 31 | # modification, are permitted provided that the following conditions are |
| 32 | # met: |
| 33 | # * Redistributions of source code must retain the above copyright |
| 34 | # notice, this list of conditions and the following disclaimer. |
| 35 | # * Redistributions in binary form must reproduce the above |
| 36 | # copyright notice, this list of conditions and the following |
| 37 | # disclaimer in the documentation and/or other materials provided |
| 38 | # with the distribution. |
| 39 | # |
| 40 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 41 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 42 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 43 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 44 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 45 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 46 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 47 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 48 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 49 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 50 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Sharad Sangle | c2a6afd | 2016-06-30 17:17:38 +0530 | [diff] [blame] | 51 | |
Karthik Reddy Katta | a0da128 | 2016-07-25 11:02:14 +0530 | [diff] [blame] | 52 | #debugfs access to audio |
| 53 | userdebug_or_eng(` |
Ravi Kumar Siddojigari | 92eed18 | 2017-06-27 00:25:03 +0530 | [diff] [blame] | 54 | allow audioserver qti_debugfs:dir r_dir_perms; |
| 55 | allow audioserver qti_debugfs:file rw_file_perms; |
Karthik Reddy Katta | a0da128 | 2016-07-25 11:02:14 +0530 | [diff] [blame] | 56 | ') |
Biswajit Paul | 7adcb73 | 2016-08-05 17:39:55 -0700 | [diff] [blame] | 57 | # Allow audioserver to create socket files for audio arbitration |
| 58 | allow audioserver audio_data_file:sock_file { create setattr unlink }; |
| 59 | allow audioserver audio_data_file:dir remove_name; |
Banajit Goswami | 5534b5a | 2016-08-31 11:56:59 -0700 | [diff] [blame] | 60 | |
Dhananjay Kumar | 28330e2 | 2017-05-25 13:18:05 +0530 | [diff] [blame] | 61 | # Allow audioserver to read soundcard state under /proc/asound |
| 62 | allow audioserver proc_audiod:file r_file_perms; |
| 63 | |
Rohit kumar | 35c14e1 | 2016-10-12 15:13:41 +0530 | [diff] [blame] | 64 | # Allow audioserver to read sysfs dir and sysfs_thermal files for speaker protection |
Aalique Grahame | ba7af8c | 2017-12-06 20:52:21 -0800 | [diff] [blame] | 65 | allow audioserver sysfs_audio:dir r_dir_perms; |
Rohit kumar | 35c14e1 | 2016-10-12 15:13:41 +0530 | [diff] [blame] | 66 | allow audioserver sysfs_thermal:file r_file_perms; |
| 67 | |
Banajit Goswami | 5534b5a | 2016-08-31 11:56:59 -0700 | [diff] [blame] | 68 | # Allow audioserver to access sysfs nodes |
Aalique Grahame | ba7af8c | 2017-12-06 20:52:21 -0800 | [diff] [blame] | 69 | allow audioserver sysfs_audio:file rw_file_perms; |
Biswajit Paul | 277acbb | 2016-07-20 12:02:14 -0700 | [diff] [blame] | 70 | userdebug_or_eng(` |
| 71 | diag_use(audioserver) |
| 72 | ') |
Divya Narayanan Poojary | 3a8c3c2 | 2016-10-19 13:00:49 +0530 | [diff] [blame] | 73 | |
| 74 | #Rules for audioserver to talk to peripheral manager |
Ravi Kumar Siddojigari | c7def12 | 2017-06-13 00:49:19 +0530 | [diff] [blame] | 75 | #use_per_mgr(audioserver); |
Gao Jie | 269e947 | 2016-09-19 10:39:58 +0800 | [diff] [blame] | 76 | |
| 77 | # DOLBY_START |
| 78 | allow audioserver activity_service:service_manager find; |
| 79 | set_prop(audioserver, dolby_prop) |
| 80 | # DOLBY_END |