Allow PowerStatsHAL to read NFC power state stats
This change - in combination with the associated code change - allows
PowerStatsHAL to read high-level NFC power state stats from sysfs.
Without this sepolicy, the code change produces the following errors:
02-01 20:12:40.350 1023 1023 W stats@1.0-servi: type=1400
audit(0.0:32): avc: denied { read } for name="power_stats" dev="sysfs"
ino=67037 scontext=u:r:hal_power_stats_default:s0
tcontext=u:object_r:sysfs:s0 tclass=file permissive=0
02-01 20:12:40.353 1023 1023 E libpixelpowerstats: getResults:Failed
to open file /sys/class/misc/st21nfc/device/power_stats Error =
Permission denied: Permission denied
Bug: 217388683
Test: lshal debug android.hardware.power.stats@1.0::IPowerStats/default
Change-Id: I84d212849c9e1d1b1b009387a6e689a9487a1928
diff --git a/vendor/google/genfs_contexts b/vendor/google/genfs_contexts
index fd22226..b715d8c 100644
--- a/vendor/google/genfs_contexts
+++ b/vendor/google/genfs_contexts
@@ -44,6 +44,7 @@
u:object_r:sysfs_power_stats:s0
genfscon sysfs /devices/platform/soc/98c000.i2c/i2c-1/1-001f/iio:device5
u:object_r:sysfs_power_stats:s0
+genfscon sysfs /devices/platform/soc/984000.i2c/i2c-0/0-0008/power_stats u:object_r:sysfs_power_stats:s0
# Not used by PowerStatsHal
genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm8150@0:vadc@3100/iio:device0