From 4d6a7023e1abfe50b6f97b8abd078796e57e90bd Mon Sep 17 00:00:00 2001 From: Edwin Tung Date: Tue, 22 Jun 2021 14:01:09 +0800 Subject: [PATCH] gps: add sepolicy to allow gps access pps gpio Bug: 175086879 Test: no avc deny Change-Id: I960940d7223c25732021ff4d92ae72255c044291 --- whitechapel/vendor/google/file.te | 1 + whitechapel/vendor/google/genfs_contexts | 1 + whitechapel/vendor/google/gpsd.te | 3 +++ 3 files changed, 5 insertions(+) diff --git a/whitechapel/vendor/google/file.te b/whitechapel/vendor/google/file.te index 9b4c95b4..e2baeca6 100644 --- a/whitechapel/vendor/google/file.te +++ b/whitechapel/vendor/google/file.te @@ -139,6 +139,7 @@ userdebug_or_eng(` typeattribute vendor_gps_file mlstrustedobject; ') type sysfs_gps, sysfs_type, fs_type; +type sysfs_gps_assert, sysfs_type, fs_type; # Display type sysfs_display, sysfs_type, fs_type; diff --git a/whitechapel/vendor/google/genfs_contexts b/whitechapel/vendor/google/genfs_contexts index b9a6a60f..e4871882 100644 --- a/whitechapel/vendor/google/genfs_contexts +++ b/whitechapel/vendor/google/genfs_contexts @@ -108,6 +108,7 @@ genfscon sysfs /devices/virtual/sec/tsp # GPS genfscon sysfs /devices/platform/10940000.spi/spi_master/spi5/spi5.0/nstandby u:object_r:sysfs_gps:s0 +genfscon sysfs /devices/virtual/pps/pps0/assert_elapsed u:object_r:sysfs_gps_assert:s0 # Display genfscon sysfs /devices/platform/1c2c0000.drmdsim/1c2c0000.drmdsim.0/gamma u:object_r:sysfs_display:s0 diff --git a/whitechapel/vendor/google/gpsd.te b/whitechapel/vendor/google/gpsd.te index 64591cba..791a02e4 100644 --- a/whitechapel/vendor/google/gpsd.te +++ b/whitechapel/vendor/google/gpsd.te @@ -23,3 +23,6 @@ allow gpsd hal_exynos_rild_hwservice:hwservice_manager find; # Allow gpsd to access sensor service binder_call(gpsd, system_server); allow gpsd fwk_sensor_hwservice:hwservice_manager find; + +# Allow gpsd to access pps gpio +allow gpsd sysfs_gps_assert:file r_file_perms;