From c25696d051becf63d6a08878c3822259c26b8682 Mon Sep 17 00:00:00 2001 From: Elvin Lin Date: Sat, 18 Jan 2020 09:34:44 +0800 Subject: [PATCH] [ALPS03861775] Remove the sysfs_power_supply label [Detail] Since Android P, battery-related information should be declared as native sysfs_batteryinfo, which can be accessed by healthd and other processes asking for battery information. [Solution] 1. Remove sysfs_power_supply. 2. Change the usage from sysfs_power_supply to sysfs_batteryinfo. MTK-Commit-Id: 5713190900415312f7904cdf6d46a891996d5786 Change-Id: I10099570afdb48f0806d6979a3fb11b9b9e59fbe CR-Id: ALPS03861775 Feature: Charger --- non_plat/file.te | 1 - non_plat/file_contexts | 1 - non_plat/genfs_contexts | 3 +++ non_plat/mtk_hal_camera.te | 6 +++--- non_plat/untrusted_app.te | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/non_plat/file.te b/non_plat/file.te index fafabb7..4873284 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -56,7 +56,6 @@ type proc_lk_env, fs_type; type proc_ged, fs_type; type proc_perfmgr, fs_type; type sysfs_therm, fs_type, sysfs_type; -type sysfs_power_supply, fs_type, sysfs_type; type sysfs_fps, fs_type, sysfs_type; type sysfs_ccci, fs_type, sysfs_type; type sysfs_ssw, fs_type,sysfs_type; diff --git a/non_plat/file_contexts b/non_plat/file_contexts index cb06e5c..f12be62 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -473,7 +473,6 @@ /sys/bus/platform/drivers/dev_info/dev_info u:object_r:sysfs_devinfo:s0 /sys/firmware/devicetree/base/chosen/atag\,devinfo u:object_r:sysfs_devinfo:s0 /sys/devices/virtual/thermal(/.*)? u:object_r:sysfs_therm:s0 -/sys/devices/platform/battery/power_supply(/.*)? u:object_r:sysfs_power_supply:s0 /sys/devices/virtual/switch/fps(/.*)? u:object_r:sysfs_fps:s0 /sys/class/BOOT/BOOT/boot/boot_mode(/.*)? u:object_r:sysfs_boot:s0 diff --git a/non_plat/genfs_contexts b/non_plat/genfs_contexts index 9c595e6..25da084 100644 --- a/non_plat/genfs_contexts +++ b/non_plat/genfs_contexts @@ -23,3 +23,6 @@ genfscon proc /perfmgr u:object_r:proc_perfmgr:s0 genfscon iso9660 / u:object_r:iso9660:s0 genfscon rawfs / u:object_r:rawfs:s0 genfscon fuseblk / u:object_r:fuseblk:s0 + +genfscon sysfs /devices/platform/battery/power_supply u:object_r:sysfs_batteryinfo:s0 +genfscon sysfs /devices/platform/mt_charger/power_supply u:object_r:sysfs_batteryinfo:s0 diff --git a/non_plat/mtk_hal_camera.te b/non_plat/mtk_hal_camera.te index f77df38..633044f 100644 --- a/non_plat/mtk_hal_camera.te +++ b/non_plat/mtk_hal_camera.te @@ -264,8 +264,8 @@ allow mtk_hal_camera mtk_cmdq_device:chr_file { read ioctl open }; # Date : WK17.36 # Operation : O Migration # Purpose: Allow to access battery status -allow mtk_hal_camera sysfs_power_supply:dir search; -allow mtk_hal_camera sysfs_power_supply:file { getattr open read }; +allow mtk_hal_camera sysfs_batteryinfo:dir search; +allow mtk_hal_camera sysfs_batteryinfo:file { getattr open read }; # Date : WK17.39 # Operation : O Migration @@ -291,4 +291,4 @@ allow mtk_hal_camera aee_aedv:unix_stream_socket connectto; # Date : WK18.02 # Stage: O Migration # Purpose: ISP tuning remapping -allow mtk_hal_camera mediatek_prop:property_service set; \ No newline at end of file +allow mtk_hal_camera mediatek_prop:property_service set; diff --git a/non_plat/untrusted_app.te b/non_plat/untrusted_app.te index 110653d..7dc9f3b 100644 --- a/non_plat/untrusted_app.te +++ b/non_plat/untrusted_app.te @@ -28,8 +28,8 @@ allow untrusted_app_25 proc_thermal:file { getattr open read }; allow untrusted_app_25 sysfs_fps:dir search; allow untrusted_app_25 sysfs_fps:file { getattr open read }; -allow untrusted_app_25 sysfs_power_supply:dir search; -allow untrusted_app_25 sysfs_power_supply:file { getattr open read }; +allow untrusted_app_25 sysfs_batteryinfo:dir search; +allow untrusted_app_25 sysfs_batteryinfo:file { getattr open read }; allow untrusted_app_25 sysfs_therm:dir { open read search }; allow untrusted_app_25 sysfs_therm:file { getattr open read };