From c6796f7b3a61141bc159e50c60da0784a58a13a7 Mon Sep 17 00:00:00 2001 From: Tai Kuo Date: Fri, 18 Feb 2022 16:30:04 +0800 Subject: Allow the cs40l26 audio coupled haptics Bug: 199578214 Bug: 207062207 Bug: 220068252 Test: vibrator hal can access audio path Change-Id: Ic4f433a9f6bcf2cd7dedb7e64cd41f60f25bcc65 --- vibrator/cs40l26/file_contexts | 3 +++ vibrator/cs40l26/hal_vibrator_default.te | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/vibrator/cs40l26/file_contexts b/vibrator/cs40l26/file_contexts index 13513c9..5c9f669 100644 --- a/vibrator/cs40l26/file_contexts +++ b/vibrator/cs40l26/file_contexts @@ -1,2 +1,5 @@ /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 + +/dev/snd/pcmC0D24p u:object_r:vibrator_snd_device:s0 +/dev/snd/pcmC1D24p u:object_r:vibrator_snd_device:s0 diff --git a/vibrator/cs40l26/hal_vibrator_default.te b/vibrator/cs40l26/hal_vibrator_default.te index 963a1c9..5e47136 100644 --- a/vibrator/cs40l26/hal_vibrator_default.te +++ b/vibrator/cs40l26/hal_vibrator_default.te @@ -1,6 +1,12 @@ allow hal_vibrator_default input_device:dir search; allow hal_vibrator_default input_device:chr_file rw_file_perms; +allow hal_vibrator_default audio_device:dir search; +allow hal_vibrator_default proc_asound:dir search; +allow hal_vibrator_default proc_asound:file r_file_perms; +allow hal_vibrator_default vibrator_snd_device:chr_file rw_file_perms; +allow hal_vibrator_default vibrator_snd_device:dir search; + 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) -- cgit v1.2.3 From d95565f08c01e7df4e359371e7ca79d05ff6859b Mon Sep 17 00:00:00 2001 From: Tai Kuo Date: Fri, 18 Feb 2022 16:38:34 +0800 Subject: Allow cs40l26 HAL and dumpsys to access sysfs_vibrator Bug: 204718450 Bug: 207062207 Bug: 220068252 Test: vibrator HAL init Test: dumpsys android.hardware.vibrator.IVibrator/default Change-Id: I3ea3418508286167d9f6f087253cc69fd82aa3a0 --- vibrator/cs40l26/hal_vibrator_default.te | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vibrator/cs40l26/hal_vibrator_default.te b/vibrator/cs40l26/hal_vibrator_default.te index 5e47136..478bee9 100644 --- a/vibrator/cs40l26/hal_vibrator_default.te +++ b/vibrator/cs40l26/hal_vibrator_default.te @@ -1,5 +1,7 @@ -allow hal_vibrator_default input_device:dir search; +allow hal_vibrator_default input_device:dir r_dir_perms; allow hal_vibrator_default input_device:chr_file rw_file_perms; +allow hal_vibrator_default sysfs_vibrator:dir search; +allow hal_vibrator_default sysfs_vibrator:file rw_file_perms; allow hal_vibrator_default audio_device:dir search; allow hal_vibrator_default proc_asound:dir search; -- cgit v1.2.3