From 4d163d5b3211cf8acfdc0658cd4aef16716358b6 Mon Sep 17 00:00:00 2001 From: Wayne Lin Date: Tue, 12 Apr 2022 12:48:01 +0800 Subject: [PATCH] gps: sync sepolicy from gs101 to allow gps access pps gpio Bug: 228903885 Test: build pass Change-Id: Ic555a0640872ae0dc1a69a9d4a11027d4364464a --- gps/file.te | 1 + gps/genfs_contexts | 1 + gps/gpsd.te | 3 +++ 3 files changed, 5 insertions(+) diff --git a/gps/file.te b/gps/file.te index 4ed25013..537afdbc 100644 --- a/gps/file.te +++ b/gps/file.te @@ -4,3 +4,4 @@ userdebug_or_eng(` ') type sysfs_gps, sysfs_type, fs_type; +type sysfs_gps_assert, sysfs_type, fs_type; diff --git a/gps/genfs_contexts b/gps/genfs_contexts index 1eab75b1..49dfdd05 100644 --- a/gps/genfs_contexts +++ b/gps/genfs_contexts @@ -1,3 +1,4 @@ # 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 diff --git a/gps/gpsd.te b/gps/gpsd.te index 64591cba..791a02e4 100644 --- a/gps/gpsd.te +++ b/gps/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;