From 3846fc25f641ddba04b4df626c9a57d8ee96b9e3 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Fri, 1 Nov 2019 14:21:03 -0700 Subject: [PATCH] Vehicle HAL: allow communication with CAN bus HAL and alternative service naming Bug: 143779011 Test: implemented a VHAL service prototype that communicates with VHAL Change-Id: I8f449510fc638e29a5cb23c0e32f3d87386ba9bc --- vendor/file_contexts | 2 +- vendor/hal_vehicle_default.te | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vendor/file_contexts b/vendor/file_contexts index 07aaf5bf6..777a86db1 100644 --- a/vendor/file_contexts +++ b/vendor/file_contexts @@ -6,7 +6,7 @@ /(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.audiocontrol@1\.0-service u:object_r:hal_audiocontrol_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.can@1\.0-service u:object_r:hal_can_socketcan_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.evs@1\.[0-9]-service u:object_r:hal_evs_default_exec:s0 -/(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.vehicle@2\.0-service u:object_r:hal_vehicle_default_exec:s0 +/(vendor|system/vendor)/bin/hw/android\.hardware\.automotive\.vehicle@2\.0-(service|protocan-service) u:object_r:hal_vehicle_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.bluetooth@1\.0-service u:object_r:hal_bluetooth_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.bluetooth@1\.0-service\.btlinux u:object_r:hal_bluetooth_btlinux_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service u:object_r:hal_fingerprint_default_exec:s0 diff --git a/vendor/hal_vehicle_default.te b/vendor/hal_vehicle_default.te index e605ecbf1..dcb03a871 100644 --- a/vendor/hal_vehicle_default.te +++ b/vendor/hal_vehicle_default.te @@ -5,3 +5,8 @@ hal_server_domain(hal_vehicle_default, hal_vehicle) # may be started by init type hal_vehicle_default_exec, exec_type, vendor_file_type, file_type; init_daemon_domain(hal_vehicle_default) + +# communication with CAN bus HAL +allow hal_vehicle_default hal_can_bus_hwservice:hwservice_manager find; +allow hal_vehicle_default hal_can_socketcan:binder { call transfer }; +allow hal_can_socketcan hal_vehicle_default:binder { call transfer };