From 656f465824d25f47fb8fcddd4365d6bd5351af70 Mon Sep 17 00:00:00 2001 From: Qimeng Pan Date: Wed, 11 Jan 2023 16:26:09 +0800 Subject: [PATCH] sepolicy_vndr: Add power off alarm AIDL policy Add power off alarm AIDL policy Change-Id: I638ce2821396a620de3474d73f5ba65b42629b85 --- .../vendor/common/hal_alarm_qti_default.te | 4 +++ generic/vendor/common/service.te | 33 +++++++++++++++++++ qva/vendor/common/file_contexts | 1 + qva/vendor/common/service_contexts | 1 + 4 files changed, 39 insertions(+) create mode 100644 generic/vendor/common/service.te diff --git a/generic/vendor/common/hal_alarm_qti_default.te b/generic/vendor/common/hal_alarm_qti_default.te index c65d2e91..9996dd32 100755 --- a/generic/vendor/common/hal_alarm_qti_default.te +++ b/generic/vendor/common/hal_alarm_qti_default.te @@ -34,3 +34,7 @@ type vendor_hal_alarm_qti_default_exec, exec_type, vendor_file_type, file_type; init_daemon_domain(vendor_hal_alarm_qti_default) allow vendor_hal_alarm_qti_default rtc_device:chr_file r_file_perms; + +#Add rules for power off alarm AIDL hal +hal_attribute_service(vendor_hal_alarm_qti, vendor_hal_alarm_qti_aidl_service) +binder_call(vendor_hal_alarm_qti_server, servicemanager) diff --git a/generic/vendor/common/service.te b/generic/vendor/common/service.te new file mode 100644 index 00000000..6ea571f5 --- /dev/null +++ b/generic/vendor/common/service.te @@ -0,0 +1,33 @@ +# Copyright (c) 2021-2023 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. + +type vendor_hal_alarm_qti_aidl_service, hal_service_type, protected_service, service_manager_type; diff --git a/qva/vendor/common/file_contexts b/qva/vendor/common/file_contexts index 9d06c850..4e77eb8b 100644 --- a/qva/vendor/common/file_contexts +++ b/qva/vendor/common/file_contexts @@ -84,6 +84,7 @@ /vendor/bin/hw/vendor\.nxp\.hardware\.nfc@1\.2-service u:object_r:hal_nfc_default_exec:s0 /vendor/bin/hw/vendor\.nxp\.hardware\.nfc@2\.0-service u:object_r:hal_nfc_default_exec:s0 /vendor/bin/hw/vendor\.qti\.hardware\.alarm@1\.0-service u:object_r:vendor_hal_alarm_qti_default_exec:s0 +/vendor/bin/hw/vendor\.qti\.hardware\.alarm-service u:object_r:vendor_hal_alarm_qti_default_exec:s0 /vendor/bin/hw/vendor\.qti\.hardware\.iop@2\.0-service u:object_r:vendor_hal_iop_default_exec:s0 /vendor/bin/hw/vendor\.qti\.hardware\.qteeconnector@1\.0-service u:object_r:vendor_hal_qteeconnector_qti_exec:s0 /vendor/bin/hw/vendor\.qti\.hardware\.qseecom@1\.0-service u:object_r:vendor_hal_qseecom_default_exec:s0 diff --git a/qva/vendor/common/service_contexts b/qva/vendor/common/service_contexts index f45f1d36..5d68a80b 100644 --- a/qva/vendor/common/service_contexts +++ b/qva/vendor/common/service_contexts @@ -30,3 +30,4 @@ vendor.qti.hardware.qxr.IQXRCamService/default u:object_r:vendor_hal_qvr vendor.qti.hardware.qxr.IQXRModService/default u:object_r:vendor_hal_qvrd_service:s0 vendor.qti.hardware.qxr.IQXRSplitService/default u:object_r:vendor_hal_sxrd_service:s0 vendor.qti.hardware.qxr.IQXRAudioService/default u:object_r:vendor_hal_sxrd_service:s0 +vendor.qti.hardware.alarm.IAlarm/default u:object_r:vendor_hal_alarm_qti_aidl_service:s0