From 6a0e7e04f2950da6b5007a2867bc5c390eab1167 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 18 Jan 2020 10:02:32 +0800 Subject: [PATCH] [ALPS03885057] Add label for MTK USB HIDL 1.1 [Detail] Add label and sepolicy for "android.hardware.usb@1.1-service-mediatek" MTK-Commit-Id: 7d1f78831d049318d4623d33065136303639d856 Change-Id: I72d88642485097ef42bdf38938e22eeaae1eb2e3 CR-Id: ALPS03885057 Feature: USB TYPE-C --- non_plat/file_contexts | 3 ++- non_plat/hal_usb.te | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/non_plat/file_contexts b/non_plat/file_contexts index b8d9a2b..dbb91a6 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -575,7 +575,8 @@ /(system\/vendor|vendor)/bin/hw/android\.hardware\.nfc@1\.1-service-st u:object_r:hal_nfc_default_exec:s0 # MTK Wifi Hal /(system\/vendor|vendor)/bin/hw/android\.hardware\.wifi@1\.0-service-mediatek u:object_r:mtk_hal_wifi_exec:s0 - +# MTK USB hal +/(system\/vendor|vendor)/bin/hw/android\.hardware\.usb@1\.1-service-mediatek u:object_r:mtk_hal_usb_exec:s0 ############################# # System/bin files diff --git a/non_plat/hal_usb.te b/non_plat/hal_usb.te index 33e78d1..3d43bee 100644 --- a/non_plat/hal_usb.te +++ b/non_plat/hal_usb.te @@ -1,2 +1,11 @@ -allow hal_usb_default sysfs_dual_role_usb20:dir search; -allow hal_usb_default sysfs_dual_role_usb20:file {open read getattr}; +type mtk_hal_usb, domain; +hal_server_domain(mtk_hal_usb, hal_usb) + +type mtk_hal_usb_exec, exec_type, file_type, vendor_file_type; +init_daemon_domain(mtk_hal_usb) + +allow hal_usb_default sysfs_dual_role_usb20:dir {search read}; +allow hal_usb_default sysfs_dual_role_usb20:file {open read getattr}; + +allow mtk_hal_usb sysfs_dual_role_usb20:dir {search read}; +allow mtk_hal_usb sysfs_dual_role_usb20:file {open read getattr};