hal_usb_impl: Move hal_usb_impl and hal_usb_gadget_impl to vendor

Move hal_usb_impl and hal_usb_gadget_impl to right space

Bug: 310816620
Change-Id: I04d3710dd7f4e52b204f537de73d18a1351a6836
Signed-off-by: Chien Kun Niu <rickyniu@google.com>
This commit is contained in:
Chien Kun Niu 2023-11-14 16:17:06 +08:00
parent fac134469c
commit 84ef937a19
14 changed files with 21 additions and 22 deletions

1
vendor/file.te vendored
View file

@ -6,6 +6,7 @@ type sysfs_pca, sysfs_type, fs_type;
# debugfs
type vendor_regmap_debugfs, fs_type, debugfs_type;
type vendor_usb_debugfs, fs_type, debugfs_type;
# Data
type uwb_vendor_data_file, file_type, data_file_type, app_data_file_type;

View file

@ -2,6 +2,8 @@
/vendor/bin/hw/android\.hardware\.qorvo\.uwb\.service u:object_r:hal_uwb_vendor_default_exec:s0
/vendor/bin/init_uwb_calib u:object_r:vendor_uwb_init_exec:s0
/vendor/bin/dump/dump_power u:object_r:dump_power_exec:s0
/vendor/bin/hw/android\.hardware\.usb-service u:object_r:hal_usb_impl_exec:s0
/vendor/bin/hw/android\.hardware\.usb\.gadget-service u:object_r:hal_usb_gadget_impl_exec:s0
# Vendor
/data/vendor/uwb(/.*)? u:object_r:uwb_data_vendor:s0
@ -19,4 +21,6 @@
/dev/logbuffer_maxfg_secondary u:object_r:logbuffer_device:s0
/dev/logbuffer_maxfg_base_monitor u:object_r:logbuffer_device:s0
/dev/logbuffer_maxfg_secondary_monitor u:object_r:logbuffer_device:s0
/dev/logbuffer_tcpm u:object_r:logbuffer_device:s0
/dev/logbuffer_usbpd u:object_r:logbuffer_device:s0

View file

@ -2,9 +2,12 @@
genfscon sysfs /devices/platform/google,charger u:object_r:sysfs_batteryinfo:s0
genfscon sysfs /devices/platform/10c90000.hsi2c/i2c-9/9-006e/chg_stats u:object_r:sysfs_pca:s0
genfscon sysfs /devices/platform/10ca0000.hsi2c/i2c-10/10-006e/chg_stats u:object_r:sysfs_pca:s0
genfscon sysfs /devices/platform/108d0000.hsi2c/i2c-6/6-0025/typec u:object_r:sysfs_batteryinfo:s0
genfscon sysfs /devices/platform/10cb0000.hsi2c/i2c-11/11-0025/typec u:object_r:sysfs_batteryinfo:s0
# debugfs
genfscon debugfs /regmap u:object_r:vendor_regmap_debugfs:s0
genfscon debugfs /usb u:object_r:vendor_usb_debugfs:s0
# GPU
genfscon sysfs /devices/platform/1f000000.mali/hint_min_freq u:object_r:sysfs_gpu:s0
@ -19,9 +22,13 @@ genfscon sysfs /devices/platform/10c90000.hsi2c/i2c-9/9-0043
# wake up nodes
genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/wakeup/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.8.auto/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.8.auto/usb1/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/xhci-hcd-exynos.8.auto/usb2/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/17000000.aoc/usb_control/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/108d0000.hsi2c/i2c-6/6-0025/power_supply/usb/power/wakeup u:object_r:sysfs_wakeup:s0
genfscon sysfs /devices/platform/10cb0000.hsi2c/i2c-11/11-0025/power_supply/usb/power/wakeup u:object_r:sysfs_wakeup:s0
# GPU
genfscon sysfs /devices/platform/1f000000.mali/cur_freq u:object_r:sysfs_gpu:s0

20
vendor/hal_usb_gadget_impl.te vendored Normal file
View file

@ -0,0 +1,20 @@
type hal_usb_gadget_impl, domain;
hal_server_domain(hal_usb_gadget_impl, hal_usb)
hal_server_domain(hal_usb_gadget_impl, hal_usb_gadget)
type hal_usb_gadget_impl_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(hal_usb_gadget_impl)
allow hal_usb_gadget_impl configfs:dir { create rmdir };
allow hal_usb_gadget_impl functionfs:dir { watch watch_reads };
set_prop(hal_usb_gadget_impl, vendor_usb_config_prop)
# parser the number of dwc3 irq
allow hal_usb_gadget_impl proc_interrupts:file r_file_perms;
# change irq to other cores
allow hal_usb_gadget_impl proc_irq:dir r_dir_perms;
allow hal_usb_gadget_impl proc_irq:file w_file_perms;
allow hal_usb_gadget_impl sysfs_batteryinfo:dir r_dir_perms;
allow hal_usb_gadget_impl sysfs_batteryinfo:file rw_file_perms;

16
vendor/hal_usb_impl.te vendored Normal file
View file

@ -0,0 +1,16 @@
type hal_usb_impl, domain;
type hal_usb_impl_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(hal_usb_impl)
hal_server_domain(hal_usb_impl, hal_usb)
hal_server_domain(hal_usb_impl, hal_usb_gadget)
allow hal_usb_impl sysfs_batteryinfo:dir r_dir_perms;
allow hal_usb_impl sysfs_batteryinfo:file rw_file_perms;
# Needed for monitoring usb port temperature
allow hal_usb_impl self:capability2 wake_alarm;
wakelock_use(hal_usb_impl);
# For interfacing with ThermalHAL
hal_client_domain(hal_usb_impl, hal_thermal);

3
vendor/property.te vendored Normal file
View file

@ -0,0 +1,3 @@
# USB
vendor_internal_prop(vendor_usb_config_prop)

4
vendor/property_contexts vendored Normal file
View file

@ -0,0 +1,4 @@
# USB
persist.vendor.usb. u:object_r:vendor_usb_config_prop:s0
vendor.usb. u:object_r:vendor_usb_config_prop:s0

2
vendor/vendor_init.te vendored Normal file
View file

@ -0,0 +1,2 @@
# USB property
set_prop(vendor_init, vendor_usb_config_prop)