From e306107be1e9459ba79741c6fcd6ccce35ccc59e Mon Sep 17 00:00:00 2001 From: Tai Kuo Date: Mon, 12 Apr 2021 22:03:25 +0800 Subject: vibrator: cs40l26: setup sepolicy Bug: 184610991 Test: Service and HAL can init properly from rc Signed-off-by: Tai Kuo Change-Id: I9d72f564688f56f7415d7398b032df375d86e37c --- vibrator/cs40l26/file_contexts | 2 ++ vibrator/cs40l26/hal_vibrator_default.te | 11 +++++++++++ vibrator/cs40l26/property_contexts | 1 + vibrator/cs40l26/vendor_init.te | 1 + 4 files changed, 15 insertions(+) create mode 100644 vibrator/cs40l26/file_contexts create mode 100644 vibrator/cs40l26/hal_vibrator_default.te create mode 100644 vibrator/cs40l26/property_contexts create mode 100644 vibrator/cs40l26/vendor_init.te diff --git a/vibrator/cs40l26/file_contexts b/vibrator/cs40l26/file_contexts new file mode 100644 index 0000000..13513c9 --- /dev/null +++ b/vibrator/cs40l26/file_contexts @@ -0,0 +1,2 @@ +/vendor/bin/hw/android\.hardware\.vibrator-service\.cs40l26 u:object_r:hal_vibrator_default_exec:s0 +/vendor/bin/hw/android\.hardware\.vibrator-service\.cs40l26-dual u:object_r:hal_vibrator_default_exec:s0 diff --git a/vibrator/cs40l26/hal_vibrator_default.te b/vibrator/cs40l26/hal_vibrator_default.te new file mode 100644 index 0000000..963a1c9 --- /dev/null +++ b/vibrator/cs40l26/hal_vibrator_default.te @@ -0,0 +1,11 @@ +allow hal_vibrator_default input_device:dir search; +allow hal_vibrator_default input_device:chr_file rw_file_perms; + +allow hal_vibrator_default mnt_vendor_file:dir search; +allow hal_vibrator_default persist_file:dir search; +r_dir_file(hal_vibrator_default, persist_haptics_file) + +get_prop(hal_vibrator_default, vendor_vibrator_prop); + +# Allow vibrator HAL's default implementation to use vendor-binder service +vndbinder_use(hal_vibrator_default); diff --git a/vibrator/cs40l26/property_contexts b/vibrator/cs40l26/property_contexts new file mode 100644 index 0000000..64a2600 --- /dev/null +++ b/vibrator/cs40l26/property_contexts @@ -0,0 +1 @@ +ro.vendor.vibrator.hal. u:object_r:vendor_vibrator_prop:s0 diff --git a/vibrator/cs40l26/vendor_init.te b/vibrator/cs40l26/vendor_init.te new file mode 100644 index 0000000..417a40c --- /dev/null +++ b/vibrator/cs40l26/vendor_init.te @@ -0,0 +1 @@ +set_prop(vendor_init, vendor_vibrator_prop) -- cgit v1.2.3