From 49a3cfae3a31fcc1346fb988d10a1c74269a8a24 Mon Sep 17 00:00:00 2001 From: Cheney Ni Date: Mon, 18 Jul 2022 17:36:31 +0000 Subject: [PATCH] Bluetooth: Allow QTI HAL service to access its logbuffer Bug: 229691092 Test: Pass file permission check Change-Id: Ic97bf3b23c452d20e5e32f3bafe2f6b2c5d2be3b --- bluetooth/file_contexts | 7 ++++++- bluetooth/hal_bluetooth_default.te | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bluetooth/file_contexts b/bluetooth/file_contexts index da02008..5560dc7 100644 --- a/bluetooth/file_contexts +++ b/bluetooth/file_contexts @@ -1,5 +1,10 @@ -# Bluetooth +# Bluetooth HAL service /vendor/bin/hw/android\.hardware\.bluetooth@1\.0-service-qti u:object_r:hal_bluetooth_default_exec:s0 +# Bluetooth Vendor nodes /dev/btpower u:object_r:bt_device:s0 /dev/ttySAC18 u:object_r:hci_attach_dev:s0 + +# Bluetooth Debuggable HAL nodes +/dev/logbuffer_btpower u:object_r:logbuffer_device:s0 +/dev/logbuffer_tty18 u:object_r:logbuffer_device:s0 diff --git a/bluetooth/hal_bluetooth_default.te b/bluetooth/hal_bluetooth_default.te index dcd2b7f..8bbfa77 100644 --- a/bluetooth/hal_bluetooth_default.te +++ b/bluetooth/hal_bluetooth_default.te @@ -3,6 +3,7 @@ allow hal_bluetooth_default bt_device:chr_file rw_file_perms; add_hwservice(hal_bluetooth_default, hal_bluetooth_coexistence_hwservice) userdebug_or_eng(` + allow hal_bluetooth_default logbuffer_device:chr_file r_file_perms; allow hal_bluetooth_default sscoredump_vendor_data_crashinfo_file:dir rw_dir_perms; allow hal_bluetooth_default sscoredump_vendor_data_crashinfo_file:file { create_file_perms }; set_prop(hal_bluetooth_default, vendor_ssrdump_prop)