From 2ee67a6bf30fae8ef76be26e9456abb7c1d1da6a Mon Sep 17 00:00:00 2001 From: Jack Wu Date: Mon, 13 Jun 2022 19:14:44 +0800 Subject: [PATCH] sepolicy: allows pixelstat to access pca file nodes Bug: 235050913 Test: no Permission denied while accessing the file node Signed-off-by: Jack Wu Change-Id: I7de0a374e1c98f4e9bbf36e39cb0131b0e9ffebc --- whitechapel_pro/file.te | 1 + whitechapel_pro/genfs_contexts | 7 +++++++ whitechapel_pro/pixelstats_vendor.te | 3 +++ 3 files changed, 11 insertions(+) diff --git a/whitechapel_pro/file.te b/whitechapel_pro/file.te index 98a8d28f..ea0caf2a 100644 --- a/whitechapel_pro/file.te +++ b/whitechapel_pro/file.te @@ -54,6 +54,7 @@ type sysfs_odpm, sysfs_type, fs_type; type sysfs_soc, sysfs_type, fs_type; type sysfs_camera, sysfs_type, fs_type; type sysfs_write_leds, sysfs_type, fs_type; +type sysfs_pca, sysfs_type, fs_type; # debugfs type debugfs_f2fs, debugfs_type, fs_type; diff --git a/whitechapel_pro/genfs_contexts b/whitechapel_pro/genfs_contexts index 797344af..87cd5c61 100644 --- a/whitechapel_pro/genfs_contexts +++ b/whitechapel_pro/genfs_contexts @@ -217,6 +217,13 @@ genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-5/5-0069/power_supply genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-6/6-0069/power_supply u:object_r:sysfs_batteryinfo:s0 genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-7/7-0069/power_supply u:object_r:sysfs_batteryinfo:s0 genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-8/8-0069/power_supply u:object_r:sysfs_batteryinfo:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-2/2-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-3/3-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-4/4-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-5/5-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-6/6-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-7/7-0057/chg_stats u:object_r:sysfs_pca:s0 +genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-8/8-0057/chg_stats u:object_r:sysfs_pca:s0 # Extcon genfscon sysfs /devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/extcon u:object_r:sysfs_extcon:s0 diff --git a/whitechapel_pro/pixelstats_vendor.te b/whitechapel_pro/pixelstats_vendor.te index d16acc0b..068e7fb8 100644 --- a/whitechapel_pro/pixelstats_vendor.te +++ b/whitechapel_pro/pixelstats_vendor.te @@ -19,3 +19,6 @@ allow pixelstats_vendor battery_history_device:chr_file r_file_perms; # storage smart idle maintenance get_prop(pixelstats_vendor, smart_idle_maint_enabled_prop); + +# Pca charge +allow pixelstats_vendor sysfs_pca:file rw_file_perms;