From 32b24c0f0b31c0db1accfb78d75f0835bcd8c936 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 10 Jan 2020 11:42:33 -0800 Subject: [PATCH] stable aidl Power HAL policy Test: boot and dumpsys -l Change-Id: I58022c9e0c24ba4e2d695acf63375c9f74c51b22 --- private/compat/29.0/29.0.ignore.cil | 1 + private/service_contexts | 5 +++-- public/hal_power.te | 4 ++++ public/service.te | 1 + vendor/file_contexts | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/private/compat/29.0/29.0.ignore.cil b/private/compat/29.0/29.0.ignore.cil index 281168343..6cb731477 100644 --- a/private/compat/29.0/29.0.ignore.cil +++ b/private/compat/29.0/29.0.ignore.cil @@ -33,6 +33,7 @@ hal_can_bus_hwservice hal_can_controller_hwservice hal_identity_hwservice + hal_power_service hal_rebootescrow_service hal_tv_tuner_hwservice hal_vibrator_service diff --git a/private/service_contexts b/private/service_contexts index 26d9f5cd3..2402ab337 100644 --- a/private/service_contexts +++ b/private/service_contexts @@ -1,5 +1,6 @@ -android.hardware.rebootescrow.IRebootEscrow/default u:object_r:hal_rebootescrow_service:s0 -android.hardware.vibrator.IVibrator/default u:object_r:hal_vibrator_service:s0 +android.hardware.power.IPower/default u:object_r:hal_power_service:s0 +android.hardware.rebootescrow.IRebootEscrow/default u:object_r:hal_rebootescrow_service:s0 +android.hardware.vibrator.IVibrator/default u:object_r:hal_vibrator_service:s0 accessibility u:object_r:accessibility_service:s0 account u:object_r:account_service:s0 diff --git a/public/hal_power.te b/public/hal_power.te index 028011ab3..2c80a5142 100644 --- a/public/hal_power.te +++ b/public/hal_power.te @@ -3,3 +3,7 @@ binder_call(hal_power_client, hal_power_server) binder_call(hal_power_server, hal_power_client) hal_attribute_hwservice(hal_power, hal_power_hwservice) + +add_service(hal_power_server, hal_power_service) +binder_call(hal_power_server, servicemanager) +allow hal_power_client hal_power_service:service_manager find; diff --git a/public/service.te b/public/service.te index 67128d2f1..1073e0c6c 100644 --- a/public/service.te +++ b/public/service.te @@ -204,6 +204,7 @@ type tethering_service, app_api_service, ephemeral_app_api_service, system_serve ### HAL Services ### +type hal_power_service, vendor_service, service_manager_type; type hal_rebootescrow_service, vendor_service, service_manager_type; type hal_vibrator_service, vendor_service, service_manager_type; diff --git a/vendor/file_contexts b/vendor/file_contexts index 4e5393965..42ea7f001 100644 --- a/vendor/file_contexts +++ b/vendor/file_contexts @@ -50,6 +50,7 @@ /(vendor|system/vendor)/bin/hw/android\.hardware\.nfc@1\.2-service u:object_r:hal_nfc_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.media\.omx@1\.0-service u:object_r:mediacodec_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.power@1\.0-service u:object_r:hal_power_default_exec:s0 +/(vendor|system/vendor)/bin/hw/android\.hardware\.power-service.example u:object_r:hal_power_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.power\.stats@1\.0-service u:object_r:hal_power_stats_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.radio\.config@1\.0-service u:object_r:hal_radio_config_default_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.radio@1\.2-radio-service u:object_r:hal_radio_default_exec:s0