# Copyright (c) 2018, 2020 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.
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
#       contributors may be used to endorse or promote products derived
#       from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.

/(vendor|system/vendor)/bin/kernel-tests/smd.* u:object_r:vendor_smd_test_exec:s0
/(vendor|system/vendor)/bin/qmi-framework-tests/qmi_ping.*      u:object_r:vendor_qmi_ping_exec:s0
/(vendor|system/vendor)/bin/qmi-framework-tests/qmi_test.*      u:object_r:vendor_qmi_test_service_exec:s0

/(vendor|system/vendor)/bin/diag_dci_client      u:object_r:vendor_diagdciclient_exec:s0
/vendor/bin/diag-router         u:object_r:vendor_diag-router_exec:s0
/(vendor|system/vendor)/bin/ptt_socket_app      u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/athdiag             u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/cld-fwlog-netlink                   u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/cld-fwlog-record                    u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/cld-fwlog-parser                    u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/cnss_diag           u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iwpriv                              u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iwconfig                            u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iw                                  u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iwlist                              u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iwss_test                           u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/pktlogconf                          u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/iperf                               u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/mboxping                            u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/sigma_dut                           u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/pktlog                              u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/hal_proxy_daemon    u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/Wifilogger_app      u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/hs20-osu-client                     u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/ndc                                 u:object_r:vendor_wcnss_service_exec:s0
/(vendor|system/vendor)/bin/playreadygtest(.*)                  u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/oem(.*)test                         u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/widevine(.*)                        u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/qseecom_sample_client               u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/isdbtmmtest                         u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/secure_ui_sample_client u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/qseecom_security_test               u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/qfipsverify                         u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/qseecom_assurance_test              u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/drm_generic_prov_test               u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/ParserApp                           u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/StoreKeybox         u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/InstallKeybox                       u:object_r:vendor_sectest_exec:s0
/(vendor|system/vendor)/bin/tracing_config\.sh        u:object_r:vendor_smtrace_tracing_exec:s0

# TLPD
/vendor/bin/ipa_lnx_agent                                       u:object_r:vendor_ipa_lnx_agent_exec:s0
/dev/ipa_lnx_stats_ioctl                                        u:object_r:vendor_ipa_lnx_agent_device:s0

#Authentication and FIDO
/(vendor|system/vendor)/bin/sampleauthdaemon    u:object_r:vendor_fidotest_exec:s0
/(vendor|system/vendor)/bin/qseeproxysampledaemon u:object_r:vendor_qseeproxysample_exec:s0

#### Context for location test binaries
/(vendor|system/vendor)/bin/slim_client                         u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/lowi_test                           u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/test-version                        u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/test-pos-tx                         u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/xtwifi-upload-test                  u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/test-fake-ap                        u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/test-fdal                           u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/qsh_location_test                   u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/qsh_geofence_test                   u:object_r:vendor_location_test_exec:s0
/(vendor|system/vendor)/bin/qsh_slpi_loc_test                   u:object_r:vendor_location_test_exec:s0

#### Context for qguard
/(vendor|system/vendor)/bin/qguard        u:object_r:vendor_qguard_exec:s0

#For debug script
/(vendor|system/vendor)/bin/init\.qti\.kernel\.debug\.sh        u:object_r:vendor_qti_init_shell_exec:s0

/(vendor|system/vendor)/bin/sns.*               u:object_r:vendor_sensors_test_exec:s0
#for testscripts support
/(vendor|system/vendor)/bin/init\.qcom\.vendor\.testscripts\.sh u:object_r:vendor-qti-testscripts_exec:s0
#TODO: coredump_file need have a attribute of data_file_type and
# is going to show compile time issue need to fix this
#Context for GPU applications
#/data/vendor/gpu(/.*)?				u:object_r:coredump_file:s0
/sys/devices(/platform)?/soc/[a-f0-9]+.qcom,kgsl-3d0/kgsl/kgsl-3d0/snapshot(/.*)? u:object_r:vendor_sysfs_kgsl_snapshot:s0

# Console via JTAG - debug only
/dev/hvc0							u:object_r:console_device:s0
/data/vendor/gpu(/.*)? u:object_r:vendor_gles_data_file:s0
/data/vendor/ts_loopback(/.*)?                                  u:object_r:vendor_ts_loopback_data_file:s0

# snapcam libs
/vendor/lib(64)?/libjni_imageutil\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libjni_mfnrutil\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libjni_aidenoiserutil\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libjni_aidenoiserutilv2\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libmmcamera_mfnr\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libaidenoiser\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libaidenoiserv2\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libopencv\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libofflinelog\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libbitmlenginev2\.so       u:object_r:same_process_hal_file:s0
/vendor/lib/rfsa/adsp/libbitml_nsp_v2_skel\.so       u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libbitmlengine\.so       u:object_r:same_process_hal_file:s0

#fan_service
/(vendor|system/vendor)/bin/fan_service u:object_r:vendor_fan_service_exec:s0

## ddi image
/data/vendor/ddi(/.*)?      u:object_r:vendor_ddi_file:s0
