• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ==============================================
2# Policy File of /system/bin/fuelgauged Executable File
3
4# ==============================================
5# Type Declaration
6# ==============================================
7type fuelgauged ,domain;
8type fuelgauged_exec , exec_type, file_type, vendor_file_type;
9type fuelgauged_file, file_type, data_file_type;
10
11# ==============================================
12# Android Policy Rule
13# ==============================================
14
15# ==============================================
16# NSA Policy Rule
17# ==============================================
18
19# ==============================================
20# MTK Policy Rule
21# ==============================================
22
23init_daemon_domain(fuelgauged)
24
25# Data : WK14.43
26# Operation : Migration
27# Purpose : Fuel Gauge daemon for access driver node
28allow fuelgauged input_device:dir rw_dir_perms;
29allow fuelgauged input_device:file r_file_perms;
30
31# Data : WK14.43
32# Operation : Migration
33# Purpose : For meta tool calibration
34allow fuelgauged mtk-adc-cali_device:chr_file rw_file_perms;
35
36# Data : WK14.43
37# Operation : Migration
38# Purpose : For fg.log can be printed with kernel log
39allow fuelgauged kmsg_device:chr_file w_file_perms;
40
41# Data : WK14.43
42# Operation : Migration
43# Purpose : For fg daemon can comminucate with kernel
44allow fuelgauged self:netlink_socket create;
45allow fuelgauged self:netlink_socket create_socket_perms_no_ioctl;
46allow fuelgauged self:netlink_route_socket { bind create getattr write nlmsg_read read nlmsg_write };
47
48# Data : WK16.39
49allow fuelgauged self:capability { chown fsetid };
50
51# Date: W17.22
52# Operation : New Feature
53# Purpose : Add for A/B system
54allow fuelgauged kernel:system module_request;
55
56# Date: W18.03
57# Operation : change fuelgagued access from cache to nvcfg
58# Purpose : add fuelgauged to nvcfg read write permit
59allow fuelgauged nvcfg_file:dir create_dir_perms;
60allow fuelgauged nvcfg_file:file create_file_perms;
61
62# Date: W18.17
63# Operation : add label for /sys/devices/platform/battery(/.*)
64# Purpose : add fuelgauged could access
65r_dir_file(fuelgauged, sysfs_batteryinfo);
66
67# Date : WK18.21
68# Operation: P migration
69# Purpose: Allow to search /mnt/vendor/nvdata for fstab when using NVM_Init()
70allow fuelgauged mnt_vendor_file:dir search;
71
72