[ALPS03866092] BT HCI snoop log (2/2)

[Detail]
1. Add selinux right for MTKLogger to able to connect Bluetooth
via socket
2. Add selinux right for Bluetooth to set debug property for
MTKLogger state check

MTK-Commit-Id: db60d64b8ed91dfee48588fb5a32f2bedc2ba604

Change-Id: I31c5abb153c2bcd44a2dafca0f1f669e7310c3fe
CR-Id: ALPS03866092
Feature: BT AOSP
This commit is contained in:
Peng Qi 2020-01-18 09:45:40 +08:00 committed by Peng QI
parent f0be2264f5
commit bf77ac2d12
5 changed files with 59 additions and 3 deletions

View File

@ -8,3 +8,14 @@
binder_call(bluetooth, mtk_hal_bluetooth)
allow bluetooth storage_stub_file:dir getattr;
# Date: 2018/01/17
#allow bluetooth to set property
set_prop(bluetooth, vendor_bluetooth_prop)
set_prop(bluetooth, debug_prop)
# Date: 2018/02/02
# Major permission allow are in /system/sepoplicy/private/bluetooth.te
# Add dir create perms for bluetooth on /data/misc/bluetooth/logs
allow bluetooth bluetooth_logs_data_file:dir { create_dir_perms relabelto };
allow bluetooth bluetooth_logs_data_file:fifo_file { create_file_perms };

View File

@ -26,6 +26,9 @@ allow platform_app mdlogger:unix_stream_socket connectto;
allow platform_app emdlogger:unix_stream_socket connectto;
allow platform_app cmddumper:unix_stream_socket connectto;
unix_socket_connect(platform_app, netdiag, netdiag)
# Date: 2018/11/17
# purpose: allow MTKLogger to control Bluetooth HCI log via socket
allow platform_app bluetooth:unix_stream_socket connectto;
# Date : 2014/10/17
# Operation : Migration

View File

@ -167,3 +167,6 @@ type vendor_consyslogger_prop, property_type, mtk_core_property_type;
#=============radio group property=============
type vendor_radio_prop, property_type, mtk_core_property_type;
#=============allow bluetooth==============
type vendor_bluetooth_prop, property_type, mtk_core_property_type;

View File

@ -177,3 +177,6 @@ vendor.ril. u:object_r:vendor_radio_prop:s0
ro.vendor.ril. u:object_r:vendor_radio_prop:s0
vendor.gsm. u:object_r:vendor_radio_prop:s0
persist.vendor.radio. u:object_r:vendor_radio_prop:s0
#=============allow bluetooth==============
vendor.bthcisnoop u:object_r:vendor_bluetooth_prop:s0

36
plat_private/bluetooth.te Normal file
View File

@ -0,0 +1,36 @@
# ==============================================
# MTK Bluetooth Policy Rule
# Add permission only for platform system
# ==============================================
# Date: 2018/02/02
# Add permission for different storage types logging
# permission in storage for legacy android M version
allow bluetooth mnt_user_file:dir search;
allow bluetooth mnt_user_file:lnk_file read;
allow bluetooth storage_file:lnk_file read;
# purpose: allow access storage for legacy N version
allow bluetooth media_rw_data_file:file { create_file_perms };
allow bluetooth media_rw_data_file:dir { create_dir_perms };
# permission for storage link access in vzw Project
allow bluetooth mnt_media_rw_file:dir search;
# for logging sdcard access
allow bluetooth sdcard_type:dir { create_dir_perms };
allow bluetooth sdcard_type:file { create_file_perms };
allow bluetooth sdcardfs:dir { create_dir_perms };
allow bluetooth sdcardfs:file { create_file_perms };
allow bluetooth rootfs:lnk_file getattr;
allow bluetooth fuse:dir { create_dir_perms };
allow bluetooth fuse:file { create_file_perms };
# permission for storage access storage
allow bluetooth vfat:dir create_dir_perms;
allow bluetooth vfat:file create_file_perms;
allow bluetooth storage_file:dir { create_dir_perms };
allow bluetooth tmpfs:lnk_file read;
allow bluetooth storage_file:file { create_file_perms };