Merge tag 'LA.VENDOR.1.0.r1-24300-WAIPIO.QSSI14.0' of https://git.codelinaro.org/clo/la/device/qcom/sepolicy_vndr into lineage-21.0-caf-sm8450

"LA.VENDOR.1.0.r1-24300-WAIPIO.QSSI14.0"

* tag 'LA.VENDOR.1.0.r1-24300-WAIPIO.QSSI14.0' of https://git.codelinaro.org/clo/la/device/qcom/sepolicy_vndr:
  controller: Upload Firmware2.0 code to add sepolicy
  Sepolicy_vndr : Multiple AVC denial fixes for clarence
  anorak: allow qvrservice to access ipd distance node
  controller:give controller read access to /mnt/vendor/calib dir

Change-Id: I434bdfd04ba03f587008b2d77db062e25404afd2
diff --git a/generic/vendor/anorak/genfs_contexts b/generic/vendor/anorak/genfs_contexts
index bfdce6d..a95eb11 100644
--- a/generic/vendor/anorak/genfs_contexts
+++ b/generic/vendor/anorak/genfs_contexts
@@ -219,3 +219,4 @@
 genfscon sysfs /devices/platform/soc/988000.i2c/i2c-0/0-0010/far_res u:object_r:vendor_sysfs_ipd:s0
 genfscon sysfs /devices/platform/soc/988000.i2c/i2c-0/0-0010/near_ipd u:object_r:vendor_sysfs_ipd:s0
 genfscon sysfs /devices/platform/soc/988000.i2c/i2c-0/0-0010/far_ipd u:object_r:vendor_sysfs_ipd:s0
+genfscon sysfs /devices/platform/soc/988000.i2c/i2c-0/0-0010/ipd_distance u:object_r:vendor_sysfs_ipd_distance:s0
diff --git a/generic/vendor/parrot/cnd.te b/generic/vendor/parrot/cnd.te
new file mode 100644
index 0000000..80aa2eb
--- /dev/null
+++ b/generic/vendor/parrot/cnd.te
@@ -0,0 +1,4 @@
+# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause-Clear
+
+hal_attribute_service(vendor_hal_datafactory_qti, vendor_hal_factory_aidlservice)
diff --git a/generic/vendor/parrot/hal_perf_default.te b/generic/vendor/parrot/hal_perf_default.te
index 8170394..44a4937 100644
--- a/generic/vendor/parrot/hal_perf_default.te
+++ b/generic/vendor/parrot/hal_perf_default.te
@@ -62,3 +62,7 @@
 allow vendor_hal_perf_default self:capability kill;
 allow vendor_hal_perf_default {appdomain}:process sigkill;
 hal_client_domain(vendor_hal_perf_default, vendor_hal_poweroptservice)
+
+#Allow AIDL base perf-hal communication
+hal_attribute_service(vendor_hal_perf, vendor_hal_perf2_service)
+binder_call(vendor_hal_perf_server, servicemanager)
diff --git a/generic/vendor/parrot/service.te b/generic/vendor/parrot/service.te
new file mode 100644
index 0000000..2965deb
--- /dev/null
+++ b/generic/vendor/parrot/service.te
@@ -0,0 +1,6 @@
+# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause-Clear
+
+type vendor_hal_factory_aidlservice, vendor_service, protected_service, service_manager_type;
+type vendor_hal_perf2_service,           vendor_service, protected_service, service_manager_type;
+type vendor_hal_dpmaidl_service,         vendor_service, protected_service, service_manager_type;
diff --git a/generic/vendor/parrot/service_contexts b/generic/vendor/parrot/service_contexts
new file mode 100644
index 0000000..548cd68
--- /dev/null
+++ b/generic/vendor/parrot/service_contexts
@@ -0,0 +1,7 @@
+# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause-Clear
+
+vendor.qti.data.factoryservice.IFactory/default          u:object_r:vendor_hal_factory_aidlservice:s0
+vendor.qti.hardware.perf2.IPerf/default                u:object_r:vendor_hal_perf2_service:s0
+vendor.qti.hardware.dpmaidlservice.IDpmService/default u:object_r:vendor_hal_dpmaidl_service:s0
+
diff --git a/qva/vendor/anorak/file.te b/qva/vendor/anorak/file.te
index 37cecce..a7e93d0 100644
--- a/qva/vendor/anorak/file.te
+++ b/qva/vendor/anorak/file.te
@@ -32,6 +32,7 @@
 # nordic node file
 type vendor_nordic_sysfs_node, sysfs_type, fs_type;
 
+type vendor_ttyKXR2, dev_type, file_type;
 
 # kineticsxr file
 type vendor_kx_file, file_type, vendor_file_type;
@@ -40,3 +41,6 @@
 type vendor_calib_file, file_type, vendor_calib_file_type;
 allow { vendor_calib_file }self:filesystem associate;
 type vendor_sysfs_ipd, sysfs_type, fs_type;
+
+#ipd_distance
+type vendor_sysfs_ipd_distance, sysfs_type, fs_type;
diff --git a/qva/vendor/anorak/file_contexts b/qva/vendor/anorak/file_contexts
index 2b3f35e..26c5299 100644
--- a/qva/vendor/anorak/file_contexts
+++ b/qva/vendor/anorak/file_contexts
@@ -33,9 +33,9 @@
 /(vendor|system/vendor)/bin/hw/vendor\.kineticsxr\.hardware\.nordic@1\.0-service u:object_r:vendor_hal_nordic_default_exec:s0
 /sys/devices/platform/soc/990000\.spi/spi_master/spi0/spi0\.0/jsrequest u:object_r:vendor_nordic_sysfs_node:s0
 /sys/devices/platform/soc/990000\.spi/spi_master/spi0/spi0\.0/jsmem u:object_r:vendor_nordic_sysfs_node:s0
-
+/dev/ttyKXR2                          u:object_r:vendor_ttyKXR2:s0
 # kineticsxr file
-/etc/resources_ctrlr(/.*)?			u:object_r:vendor_kx_file:s0
+/etc/resources_ctrlr(/.*)?            u:object_r:vendor_kx_file:s0
 
 # calib partition
 /mnt/vendor/calib(/.*)?               u:object_r:vendor_calib_file:s0
diff --git a/qva/vendor/anorak/hal_nordic_default.te b/qva/vendor/anorak/hal_nordic_default.te
index 0a3003e..bb9f919 100644
--- a/qva/vendor/anorak/hal_nordic_default.te
+++ b/qva/vendor/anorak/hal_nordic_default.te
@@ -32,3 +32,7 @@
 allow vendor_hal_nordic_default vendor_kx_file:file { open read getattr };
 allow vendor_hal_nordic_default dmabuf_system_heap_device:chr_file { read open ioctl };
 allow vendor_hal_nordic_default dmabuf_system_heap_device:chr_file { read open ioctl };
+allow vendor_hal_nordic_default mnt_vendor_file:dir r_dir_perms;
+allow vendor_hal_nordic_default vendor_calib_file:dir r_dir_perms;
+allow vendor_hal_nordic_default vendor_calib_file:file rw_file_perms;
+allow vendor_hal_nordic_default vendor_ttyKXR2:chr_file rw_file_perms;
diff --git a/qva/vendor/anorak/qvrd_vndr.te b/qva/vendor/anorak/qvrd_vndr.te
index 66cba5f..6462569 100644
--- a/qva/vendor/anorak/qvrd_vndr.te
+++ b/qva/vendor/anorak/qvrd_vndr.te
@@ -24,3 +24,5 @@
 
 get_prop(vendor_qvrd_vndr, vendor_camera_prop)
 dontaudit vendor_qvrd_vndr vendor_hal_camera_postproc_hwservice:hwservice_manager *;
+
+allow vendor_qvrd_vndr vendor_sysfs_ipd_distance:file rw_file_perms;
diff --git a/qva/vendor/parrot/dpmd_vndr.te b/qva/vendor/parrot/dpmd_vndr.te
new file mode 100644
index 0000000..ecd113a
--- /dev/null
+++ b/qva/vendor/parrot/dpmd_vndr.te
@@ -0,0 +1,4 @@
+# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-3-Clause-Clear
+
+hal_attribute_service(vendor_hal_dpmapiservice_qti,vendor_hal_dpmaidl_service)