2020-01-18 09:29:32 +08:00
|
|
|
# ==============================================
|
|
|
|
# Policy File of /system/bin/fuelgauged Executable File
|
|
|
|
|
|
|
|
# ==============================================
|
|
|
|
# Type Declaration
|
|
|
|
# ==============================================
|
|
|
|
type fuelgauged ,domain;
|
|
|
|
type fuelgauged_exec , exec_type, file_type, vendor_file_type;
|
|
|
|
type fuelgauged_file, file_type, data_file_type;
|
|
|
|
|
|
|
|
# ==============================================
|
|
|
|
# Android Policy Rule
|
|
|
|
# ==============================================
|
|
|
|
|
|
|
|
# ==============================================
|
|
|
|
# NSA Policy Rule
|
|
|
|
# ==============================================
|
|
|
|
|
|
|
|
# ==============================================
|
|
|
|
# MTK Policy Rule
|
|
|
|
# ==============================================
|
|
|
|
|
|
|
|
init_daemon_domain(fuelgauged)
|
|
|
|
|
|
|
|
# Data : WK14.43
|
|
|
|
# Operation : Migration
|
|
|
|
# Purpose : Fuel Gauge daemon for access driver node
|
|
|
|
allow fuelgauged input_device:dir rw_dir_perms;
|
|
|
|
allow fuelgauged input_device:file r_file_perms;
|
|
|
|
|
|
|
|
# Data : WK14.43
|
|
|
|
# Operation : Migration
|
|
|
|
# Purpose : For meta tool calibration
|
|
|
|
allow fuelgauged mtk-adc-cali_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Data : WK14.43
|
|
|
|
# Operation : Migration
|
|
|
|
# Purpose : For fg.log can be printed with kernel log
|
|
|
|
allow fuelgauged kmsg_device:chr_file w_file_perms;
|
|
|
|
|
|
|
|
# Data : WK14.43
|
|
|
|
# Operation : Migration
|
|
|
|
# Purpose : For fg daemon can comminucate with kernel
|
|
|
|
### TBD, neverallowxperm on line 177 of system/sepolicy/public/domain.t
|
|
|
|
#allow fuelgauged fuelgauged:netlink_kobject_uevent_socket create_socket_perms;
|
|
|
|
#allow fuelgauged fuelgauged:netlink_socket create_socket_perms;
|
|
|
|
allow fuelgauged self:netlink_socket create;
|
|
|
|
allow fuelgauged self:netlink_socket create_socket_perms_no_ioctl;
|
|
|
|
allow fuelgauged self:netlink_route_socket { bind create getattr write nlmsg_read read nlmsg_write };
|
|
|
|
|
|
|
|
# Data : WK16.21
|
|
|
|
# Operation : New Feature
|
|
|
|
# Purpose : For fg daemon can access /data/FG folder
|
2020-01-18 09:39:17 +08:00
|
|
|
#file_type_auto_trans(fuelgauged, system_data_file, fuelgauged_file);
|
|
|
|
#allow fuelgauged fuelgauged_file:file rw_file_perms;
|
|
|
|
#typeattribute fuelgauged data_between_core_and_vendor_violators;
|
|
|
|
#allow fuelgauged system_data_file:dir rw_dir_perms;
|
2020-01-18 09:29:32 +08:00
|
|
|
|
|
|
|
# Data : WK16.21
|
|
|
|
# Operation : New Feature
|
|
|
|
# Purpose : For fg daemon can do nvram r/w to save car_tune_value
|
2020-01-18 09:39:17 +08:00
|
|
|
#allow fuelgauged nvdata_file:dir rw_dir_perms;
|
|
|
|
#allow fuelgauged nvdata_file:file {rw_file_perms create_file_perms};
|
|
|
|
#allow fuelgauged nvram_data_file:lnk_file rw_file_perms;
|
|
|
|
#allow fuelgauged nvdata_file:lnk_file rw_file_perms;
|
2020-01-18 09:29:32 +08:00
|
|
|
|
|
|
|
# Data : WK16.39
|
2020-01-18 09:29:34 +08:00
|
|
|
#allow fuelgauged self:capability { chown fsetid dac_override };
|
2020-01-18 09:29:32 +08:00
|
|
|
|
|
|
|
# Data : W16.43
|
|
|
|
# Operation : New Feature
|
|
|
|
# Purpose : Change from /data to /cache
|
2020-01-18 09:39:17 +08:00
|
|
|
#allow fuelgauged cache_file:file {rw_file_perms create_file_perms};
|
|
|
|
#allow fuelgauged cache_file:dir {rw_dir_perms create_dir_perms};
|
|
|
|
#allow fuelgauged sysfs:file {rw_file_perms create_file_perms};
|
2020-01-18 09:29:32 +08:00
|
|
|
|
|
|
|
# Date: W17.22
|
|
|
|
# Operation : New Feature
|
|
|
|
# Purpose : Add for A/B system
|
|
|
|
allow fuelgauged kernel:system module_request;
|
|
|
|
|
|
|
|
# Date: W18.03
|
|
|
|
# Operation : change fuelgagued access from cache to nvcfg
|
|
|
|
# Purpose : add fuelgauged to nvcfg read write permit
|
|
|
|
allow fuelgauged nvcfg_file:dir { search write open read add_name create getattr};
|
|
|
|
allow fuelgauged nvcfg_file:file { read write getattr open create };
|
2020-01-18 09:39:17 +08:00
|
|
|
|
|
|
|
# Date: W18.17
|
|
|
|
# Operation : add label for /sys/devices/platform/battery(/.*)
|
|
|
|
# Purpose : add fuelgauged could access
|
|
|
|
allow fuelgauged battery_node:file { read open };
|
|
|
|
|