modularize lhd

Bug: 197914244
Test: boot with lhd started
Change-Id: I873a151e4dc6e512b8831b936c3e057ae544888c
This commit is contained in:
Adam Shih 2021-08-27 11:29:09 +08:00
parent 8f611991f7
commit 99ab56746a
9 changed files with 11 additions and 11 deletions

1
gps/device.te Normal file
View file

@ -0,0 +1 @@
type vendor_gnss_device, dev_type;

View file

@ -3,3 +3,4 @@ userdebug_or_eng(`
typeattribute vendor_gps_file mlstrustedobject;
')
type sysfs_gps, sysfs_type, fs_type;

View file

@ -1,4 +1,10 @@
# gnss/gps data/log files
/data/vendor/gps(/.*)? u:object_r:vendor_gps_file:s0
# devices
/dev/bbd_control u:object_r:vendor_gnss_device:s0
/dev/ttyBCM u:object_r:vendor_gnss_device:s0
# vendor binaries
/vendor/bin/hw/scd u:object_r:scd_exec:s0
/vendor/bin/hw/lhd u:object_r:lhd_exec:s0

3
gps/genfs_contexts Normal file
View file

@ -0,0 +1,3 @@
# GPS
genfscon sysfs /devices/platform/10940000.spi/spi_master/spi5/spi5.0/nstandby u:object_r:sysfs_gps:s0

23
gps/lhd.te Normal file
View file

@ -0,0 +1,23 @@
type lhd, domain;
type lhd_exec, vendor_file_type, exec_type, file_type;
init_daemon_domain(lhd)
# Allow lhd access PixelLogger unix socket in debug build only
userdebug_or_eng(`
typeattribute lhd mlstrustedsubject;
allow lhd logger_app:unix_stream_socket connectto;
')
# Allow lhd access data vendor gps files
allow lhd vendor_gps_file:dir create_dir_perms;
allow lhd vendor_gps_file:file create_file_perms;
allow lhd vendor_gps_file:fifo_file create_file_perms;
# Allow lhd to obtain wakelock
wakelock_use(lhd)
# Allow lhd access /dev/bbd_control file
allow lhd vendor_gnss_device:chr_file rw_file_perms;
# Allow lhd access nstandby gpio
allow lhd sysfs_gps:file rw_file_perms;