From 08a574b256e182a3481af7ea89f0ec35fab08e3e Mon Sep 17 00:00:00 2001 From: Arian Date: Fri, 24 Mar 2023 14:45:31 +0100 Subject: [PATCH] sm8350-common: sepolicy: Add camera perf and postproc hwservice Change-Id: I5e054952a9739c1363294564296a26adcf3c8d8a --- sepolicy/vendor/attributes | 9 +++++++++ sepolicy/vendor/hal_camera_default.te | 9 +++++++++ sepolicy/vendor/hal_cameraperf.te | 4 ++++ sepolicy/vendor/hal_camerapostproc_xiaomi.te | 4 ++++ sepolicy/vendor/hwservice_contexts | 4 ++++ 5 files changed, 30 insertions(+) create mode 100644 sepolicy/vendor/hal_cameraperf.te create mode 100644 sepolicy/vendor/hal_camerapostproc_xiaomi.te diff --git a/sepolicy/vendor/attributes b/sepolicy/vendor/attributes index edab863..0981fe0 100644 --- a/sepolicy/vendor/attributes +++ b/sepolicy/vendor/attributes @@ -1,3 +1,12 @@ +# Camera +attribute vendor_hal_cameraperf; +attribute vendor_hal_cameraperf_client; +attribute vendor_hal_cameraperf_server; +attribute vendor_hal_camerapostproc_xiaomi; +attribute vendor_hal_camerapostproc_xiaomi_client; +attribute vendor_hal_camerapostproc_xiaomi_server; + +# Citsensor attribute vendor_hal_citsensorservice_xiaomi; attribute vendor_hal_citsensorservice_xiaomi_client; attribute vendor_hal_citsensorservice_xiaomi_server; diff --git a/sepolicy/vendor/hal_camera_default.te b/sepolicy/vendor/hal_camera_default.te index 8c1cf0a..e9e5293 100644 --- a/sepolicy/vendor/hal_camera_default.te +++ b/sepolicy/vendor/hal_camera_default.te @@ -1,6 +1,15 @@ type camera_persist_file, vendor_persist_type, file_type; +type vendor_hal_cameraperf_hwservice, hwservice_manager_type, protected_hwservice; +type vendor_hal_camerapostproc_xiaomi_hwservice, hwservice_manager_type; vendor_internal_prop(vendor_camera_sensor_prop) set_prop(hal_camera_default, vendor_camera_sensor_prop) r_dir_file(hal_camera_default, camera_persist_file) r_dir_file(hal_camera_default, mnt_vendor_file) + +hal_server_domain(hal_camera_default, vendor_hal_cameraperf) +hal_server_domain(hal_camera_default, vendor_hal_camerapostproc_xiaomi) +add_hwservice(hal_camera_server, vendor_hal_cameraperf_hwservice) +add_hwservice(hal_camera_server, vendor_hal_camerapostproc_xiaomi_hwservice) +allow hal_camera_client vendor_hal_cameraperf_hwservice:hwservice_manager find; +allow hal_camera_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; diff --git a/sepolicy/vendor/hal_cameraperf.te b/sepolicy/vendor/hal_cameraperf.te new file mode 100644 index 0000000..460de0c --- /dev/null +++ b/sepolicy/vendor/hal_cameraperf.te @@ -0,0 +1,4 @@ +add_hwservice(vendor_hal_cameraperf_server, vendor_hal_cameraperf_hwservice) +allow vendor_hal_cameraperf_client vendor_hal_cameraperf_hwservice:hwservice_manager find; +binder_call(vendor_hal_cameraperf_client, vendor_hal_cameraperf_server) +binder_call(vendor_hal_cameraperf_server, vendor_hal_cameraperf_client) diff --git a/sepolicy/vendor/hal_camerapostproc_xiaomi.te b/sepolicy/vendor/hal_camerapostproc_xiaomi.te new file mode 100644 index 0000000..3ea6494 --- /dev/null +++ b/sepolicy/vendor/hal_camerapostproc_xiaomi.te @@ -0,0 +1,4 @@ +add_hwservice(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_hwservice) +allow vendor_hal_camerapostproc_xiaomi_client vendor_hal_camerapostproc_xiaomi_hwservice:hwservice_manager find; +binder_call(vendor_hal_camerapostproc_xiaomi_client, vendor_hal_camerapostproc_xiaomi_server) +binder_call(vendor_hal_camerapostproc_xiaomi_server, vendor_hal_camerapostproc_xiaomi_client) diff --git a/sepolicy/vendor/hwservice_contexts b/sepolicy/vendor/hwservice_contexts index 4fde520..80c5f56 100644 --- a/sepolicy/vendor/hwservice_contexts +++ b/sepolicy/vendor/hwservice_contexts @@ -1,3 +1,7 @@ +# Camera +vendor.xiaomi.hardware.cameraperf::IMiCameraPerfService u:object_r:vendor_hal_cameraperf_hwservice:s0 +vendor.xiaomi.hardware.campostproc::IMiPostProcService u:object_r:vendor_hal_camerapostproc_xiaomi_hwservice:s0 + # Fingerprint vendor.xiaomi.hardware.fx.tunnel::IMiFxTunnel u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0 vendor.xiaomi.hardware.fingerprintextension::IXiaomiFingerprint u:object_r:vendor_hal_fingerprint_hwservice_xiaomi:s0