From d9313a152a384fd3666bdda7948d8996af9e9828 Mon Sep 17 00:00:00 2001 From: Jorge Lucas Date: Mon, 28 Dec 2020 11:46:10 -0300 Subject: [PATCH] msm8953-common: Add DTV Support - Add hidl to manifest - Fix Sepolicy - Add proper permissions for /dev/isdbt --- manifest.xml | 9 +++++++++ rootdir/root/ueventd.qcom.rc | 3 +++ sepolicy/vendor/device.te | 1 + sepolicy/vendor/file_contexts | 3 +++ sepolicy/vendor/init.te | 2 ++ sepolicy/vendor/isdbt_app.te | 10 ++++++++++ sepolicy/vendor/platform_app.te | 3 +++ sepolicy/vendor/seapp_contexts | 2 ++ 8 files changed, 33 insertions(+) create mode 100644 sepolicy/vendor/device.te create mode 100644 sepolicy/vendor/isdbt_app.te create mode 100644 sepolicy/vendor/seapp_contexts diff --git a/manifest.xml b/manifest.xml index bc0f315..e3edc91 100644 --- a/manifest.xml +++ b/manifest.xml @@ -642,4 +642,13 @@ default + + motorola.hardware.tv + hwbinder + 1.0 + + IDTVHW + default + + diff --git a/rootdir/root/ueventd.qcom.rc b/rootdir/root/ueventd.qcom.rc index 4de02ee..3aef712 100644 --- a/rootdir/root/ueventd.qcom.rc +++ b/rootdir/root/ueventd.qcom.rc @@ -403,3 +403,6 @@ firmware_directories /vendor/firmware_mnt/image/ /sys/class/kgsl/kgsl-3d0 force_bus_on 0664 root system /sys/class/kgsl/kgsl-3d0 force_clk_on 0664 root system /sys/class/kgsl/kgsl-3d0 bus_split 0664 root system + +#DTV +/dev/isdbt 0660 oem_5019 oem_5019 diff --git a/sepolicy/vendor/device.te b/sepolicy/vendor/device.te new file mode 100644 index 0000000..e9be694 --- /dev/null +++ b/sepolicy/vendor/device.te @@ -0,0 +1 @@ +type isdbt_device, dev_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 302d533..f0259f5 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -74,3 +74,6 @@ # Homebutton /sys/homebutton(/.*)? u:object_r:sysfs_homebutton:s0 + +# DTV +/dev/isdbt u:object_r:isdbt_device:s0 diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te index 701a91a..8f8926d 100644 --- a/sepolicy/vendor/init.te +++ b/sepolicy/vendor/init.te @@ -13,3 +13,5 @@ allow init fsg_firmware_file:filesystem getattr; allow init vendor_data_file:file lock; allow init hal_audio_default:binder call; allow init platform_app:binder call; + +allow init system_file:system module_load; diff --git a/sepolicy/vendor/isdbt_app.te b/sepolicy/vendor/isdbt_app.te new file mode 100644 index 0000000..6ff3c47 --- /dev/null +++ b/sepolicy/vendor/isdbt_app.te @@ -0,0 +1,10 @@ +type isdbt_app, domain, mlstrustedsubject; +app_domain(isdbt_app) +binder_use(isdbt_app) +allow isdbt_app isdbt_device:chr_file rw_file_perms; +allow isdbt_app media_rw_data_file:dir { rw_dir_perms create getattr rmdir search }; +allow isdbt_app { accessibility_service activity_service appops_service connectivity_service content_service display_service graphicsstats_service input_method_service input_service location_service mount_service network_management_service radio_service registry_service surfaceflinger_service textservices_service uimode_service vibrator_service wifi_service audio_service audioserver_service media_router_service notification_service autofill_service mediametrics_service mediaserver_service media_session_service mediametrics_service batterystats_service power_service user_service }:service_manager find; +allow isdbt_app telecom_service:service_manager find; +allow isdbt_app activity_task_service:service_manager find; +allow isdbt_app gpu_service:service_manager find; +allow isdbt_app uri_grants_service:service_manager find; diff --git a/sepolicy/vendor/platform_app.te b/sepolicy/vendor/platform_app.te index 8d0d23f..711ded0 100644 --- a/sepolicy/vendor/platform_app.te +++ b/sepolicy/vendor/platform_app.te @@ -1,3 +1,6 @@ +typeattribute platform_app mlstrustedsubject; + +allow platform_app isdbt_device:chr_file rw_file_perms; allow platform_app sysfs_kgsl:dir search; allow platform_app sysfs_kgsl:file { getattr open read }; allow platform_app sysfs_healthd:dir r_dir_perms; diff --git a/sepolicy/vendor/seapp_contexts b/sepolicy/vendor/seapp_contexts new file mode 100644 index 0000000..8e8e2ff --- /dev/null +++ b/sepolicy/vendor/seapp_contexts @@ -0,0 +1,2 @@ +user=_app seinfo=platform name=com.motorola.dtv domain=isdbt_app type=app_data_file levelFrom=user +user=_app seinfo=platform name=com.motorola.dtvservice domain=isdbt_app type=app_data_file levelFrom=user