Merge "sepolicy: add audio rules to qva folder"

This commit is contained in:
qctecmdr Service
2019-01-28 01:39:21 -08:00
committed by Gerrit - the friendly Code Review server
8 changed files with 94 additions and 3 deletions

View File

@@ -32,3 +32,4 @@ extphone u:object_r:radio_service:s0
qti.ims.ext u:object_r:radio_service:s0
com.qualcomm.location.izat.IzatService u:object_r:izat_service:s0
qti.security.seempspa u:object_r:seemp_service:s0
vendor.audio.vrservice u:object_r:audioserver_service:s0

View File

@@ -26,3 +26,5 @@
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
genfscon sysfs /devices/virtual/npu/msm_npu/pwr u:object_r:sysfs_npu:s0
genfscon proc /asound/card0/state u:object_r:proc_audiod:s0
genfscon proc /asound/cards u:object_r:proc_audiod:s0

42
qva/vendor/common/hal_audio.te vendored Normal file
View File

@@ -0,0 +1,42 @@
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
userdebug_or_eng(`
diag_use(hal_audio)
#Allow access to debug fs
allow hal_audio_default qti_debugfs:dir r_dir_perms;
allow hal_audio_default qti_debugfs:file rw_file_perms;
')
#Split A2dp specific
binder_call(hal_audio,bluetooth)
#to read bt props
get_prop(hal_audio, vendor_bluetooth_prop)
# Allow audio HAL to get updates from health hal
hal_client_domain(hal_audio_default, hal_health)

32
qva/vendor/common/hal_memtrack.te vendored Normal file
View File

@@ -0,0 +1,32 @@
# Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
#
# # Redistribution and use in source and binary forms, with or without
# # modification, are permitted provided that the following conditions are
# # met:
# # * Redistributions of source code must retain the above copyright
# # notice, this list of conditions and the following disclaimer.
# # * Redistributions in binary form must reproduce the above
# # copyright notice, this list of conditions and the following
# # disclaimer in the documentation and/or other materials provided
# # with the distribution.
# # * Neither the name of The Linux Foundation nor the names of its
# # contributors may be used to endorse or promote products derived
# # from this software without specific prior written permission.
# #
# # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#debugfs access to audio
userdebug_or_eng(`
allow hal_memtrack_default qti_debugfs:dir r_dir_perms;
allow hal_memtrack_default qti_debugfs:file rw_file_perms;
')

7
qva/vendor/common/init_shell.te vendored Executable file → Normal file
View File

@@ -27,4 +27,9 @@
allow qti_init_shell sysfs_npu:file rw_file_perms;
set_prop(qti_init_shell, vendor_mdm_helper_prop)
set_prop(qti_init_shell, vendor_mmi_prop)
set_prop(qti_init_shell, vendor_mmi_prop)
userdebug_or_eng(`
# Needed for starting console in userdebug mode
set_prop(qti_init_shell, vendor_audio_debug_prop)
')

5
qva/vendor/common/property.te vendored Executable file → Normal file
View File

@@ -38,4 +38,7 @@ type vendor_boot_mode_prop, property_type;
type ctl_vendor_mmid_prop, property_type;
# mmi
type vendor_mmi_prop, property_type;
type vendor_mmi_prop, property_type;
# Audio debug props
type vendor_audio_debug_prop, property_type;

View File

@@ -27,3 +27,5 @@
hal_client_domain(system_server, hal_perf)
hal_client_domain(system_server,hal_bluetooth)
allow system_server proc_audiod:file r_file_perms;

6
qva/vendor/common/vendor_init.te vendored Executable file → Normal file
View File

@@ -33,4 +33,8 @@ set_prop(vendor_init, vold_prop)
get_prop(vendor_init, vendor_boot_mode_prop)
get_prop(vendor_init, vendor_mmi_prop)
set_prop(vendor_init, vendor_usb_prop)
set_prop(vendor_init, vendor_usb_prop)
userdebug_or_eng(`
set_prop(vendor_init, vendor_audio_debug_prop)
')