From 451c9c6a6075e1d8c1b3e6afb33824e652a997e6 Mon Sep 17 00:00:00 2001 From: DJABhipHop Date: Wed, 3 Feb 2021 11:53:07 -0500 Subject: [PATCH] matissewifi: Fix policy denial for comsumerir * Prior to Q, We did not use HIDL for the comsumerir and since we do we need to fix those policy denial --- BoardConfig.mk | 7 ++++++- sepolicy/common/file_contexts | 1 + sepolicy/common/hal_ir_default.te | 2 ++ sepolicy/sepolicy.mk | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 sepolicy/common/file_contexts create mode 100644 sepolicy/common/hal_ir_default.te create mode 100644 sepolicy/sepolicy.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index b465cb5..5c5dcb5 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -16,6 +16,8 @@ # inherit from common matisse include device/samsung/matisse-common/BoardConfigCommon.mk +DEVICE_PATH := device/samsung/matissewifi + # Assert TARGET_OTA_ASSERT_DEVICE := matissewifi @@ -23,7 +25,10 @@ TARGET_OTA_ASSERT_DEVICE := matissewifi TARGET_KERNEL_CONFIG := lineage_matissewifi_defconfig # HIDL -DEVICE_MANIFEST_FILE += device/samsung/matissewifi/manifest.xml +DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/manifest.xml + +# SELinux +include $(DEVICE_PATH)/sepolicy/sepolicy.mk # inherit from the proprietary version -include vendor/samsung/matissewifi/BoardConfigVendor.mk diff --git a/sepolicy/common/file_contexts b/sepolicy/common/file_contexts new file mode 100644 index 0000000..0b3e5cf --- /dev/null +++ b/sepolicy/common/file_contexts @@ -0,0 +1 @@ +/(vendor|system/vendor)/bin/hw/android\.hardware\.ir@1\.0-service\.samsung u:object_r:hal_ir_default_exec:s0 diff --git a/sepolicy/common/hal_ir_default.te b/sepolicy/common/hal_ir_default.te new file mode 100644 index 0000000..0c41eee --- /dev/null +++ b/sepolicy/common/hal_ir_default.te @@ -0,0 +1,2 @@ +allow hal_ir_default sysfs_sec_ir:dir search; +allow hal_ir_default sysfs_sec_ir:file w_file_perms; diff --git a/sepolicy/sepolicy.mk b/sepolicy/sepolicy.mk new file mode 100644 index 0000000..d61c0e4 --- /dev/null +++ b/sepolicy/sepolicy.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2018 The LineageOS Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Board specific SELinux policy variable definitions +BOARD_SEPOLICY_DIRS += \ + device/samsung/matissewifi/sepolicy/common