sepolicy: Allow adb shell access to ftm4 autotune sysfs node

Bug: 63911898
Change-Id: Id39f48709253ce96ae7910f4e3157e2c2eda558a
This commit is contained in:
Steve Pfetsch
2017-08-06 14:55:13 -07:00
parent 2675098dd9
commit a749875aa0
5 changed files with 14 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ include device/google/wahoo/BoardConfig.mk
BOARD_BOOTIMAGE_PARTITION_SIZE := 41943040
BOARD_AVB_ENABLE := true
# sepolicy
BOARD_SEPOLICY_DIRS += device/google/taimen/sepolicy
ifeq (,$(filter-out taimen_clang, $(TARGET_PRODUCT)))
# if TARGET_PRODUCT == taimen_clang
BOARD_VENDOR_KERNEL_MODULES += \

View File

@@ -24,6 +24,10 @@ on property:sys.boot_completed=1
write /sys/block/dm-0/queue/read_ahead_kb 512
write /sys/block/dm-1/queue/read_ahead_kb 512
on boot
# Allow ftm4 autotune from adb shell
chown system shell /sys/devices/virtual/input/ftm4_touch/autotune
on init && property:ro.boot.slot=*
# will remove this once slot_suffix is deprecated
setprop ro.boot.slot_suffix _${ro.boot.slot}

1
sepolicy/file.te Normal file
View File

@@ -0,0 +1 @@
type sysfs_touch_shell, sysfs_type, fs_type;

3
sepolicy/genfs_contexts Normal file
View File

@@ -0,0 +1,3 @@
# ftm4 touch
genfscon sysfs /devices/virtual/input/ftm4_touch u:object_r:sysfs_touch:s0
genfscon sysfs /devices/virtual/input/ftm4_touch/autotune u:object_r:sysfs_touch_shell:s0

3
sepolicy/shell.te Normal file
View File

@@ -0,0 +1,3 @@
# allow adb to access /sys/devices/virtual/input/ftm4_touch/autotune
allow shell sysfs_touch:dir search;
allow shell sysfs_touch_shell:file rw_file_perms;