1# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14#avc:  denied  { get } for service=5100 pid=622 scontext=u:r:powermgr:s0 tcontext=u:object_r:sa_device_service_manager:s0 tclass=samgr_class permissive=1
15allow powermgr sa_device_service_manager:samgr_class { get };
16binder_call(powermgr, hdf_devmgr);
17
18#avc:  denied  { get } for service=3299 pid=622 scontext=u:r:powermgr:s0 tcontext=u:object_r:sa_foundation_cesfwk_service:s0 tclass=samgr_class permissive=1
19allow powermgr sa_foundation_cesfwk_service:samgr_class { get };
20
21#avc:  denied  { call } for  pid=472 comm="thermal" scontext=u:r:thermal:s0 tcontext=u:r:sh:s0 tclass=binder permissive=1
22debug_only(`
23    allow powermgr sh:binder { call };
24')
25
26#avc:  denied  { call } for  pid=472 comm="thermal" scontext=u:r:thermal:s0 tcontext=u:r:normal_hap:s0 tclass=binder permissive=1
27allow powermgr normal_hap_attr:binder { call };
28
29#avc:  denied  { get } for service=1906 pid=470 scontext=u:r:thermal:s0 tcontext=u:object_r:sa_resource_schedule_socperf_server:s0 tclass=samgr_class permissive=1
30allow powermgr sa_resource_schedule_socperf_server:samgr_class { get };
31
32#avc:  denied  { call } for  pid=412 comm="thermal" scontext=u:r:thermal:s0 tcontext=u:r:resource_schedule_service:s0 tclass=binder permissive=1
33binder_call(powermgr, resource_schedule_service);
34
35#avc:  denied  { add } for service=3303 pid=530 scontext=u:r:thermal:s0 tcontext=u:object_r:vendor_etc_file:s0 tclass=file permissive=1
36allow powermgr vendor_etc_file:file { getattr open read };
37
38#avc:  denied  { get } for service=3009 pid=2003 scontext=u:r:thermal:s0 tcontext=u:object_r:sa_audio_policy_service:s0 tclass=samgr_class permissive=1
39allow powermgr sa_audio_policy_service:samgr_class { get };
40binder_call(powermgr, audio_server);
41
42#avc:  denied  { add } for service=3303 pid=487 scontext=u:r:powermgr:s0 tcontext=u:object_r:sa_thermal_service:s0 tclass=samgr_class permissive=1
43allow powermgr sa_powermgr_thermal_service:samgr_class { add get};
44
45#avc:  denied  { search } for  pid=538 comm="powermgr" name="thermal_config" dev="mmcblk0p6" ino=874 scontext=u:r:powermgr:s0 tcontext=u:object_r:system_etc_thermal_file:s0 tclass=dir permissive=1
46allow powermgr system_etc_thermal_file:dir { search };
47
48#avc:  denied  { get } for service=801 pid=510 scontext=u:r:powermgr:s0 tcontext=u:object_r:sa_accessibleabilityms:s0 tclass=samgr_class permissive=1
49allow powermgr sa_accessibleabilityms:samgr_class { get };
50binder_call(powermgr, accessibility);
51
52#avc:  denied  { getattr } for  pid=493 comm="powermgr" path="/system/etc/thermal_config/thermal_service_config.xml" dev="mmcblk0p6" ino=916 scontext=u:r:powermgr:s0 tcontext=u:object_r:system_etc_thermal_file:s0 tclass=file permissive=1
53#avc:  denied  { read } for  pid=2200 comm="powermgr" name="thermal_service_config.xml" dev="mmcblk0p6" ino=916 scontext=u:r:powermgr:s0 tcontext=u:object_r:system_etc_thermal_file:s0 tclass=file permissive=1
54#avc:  denied  { open } for  pid=2205 comm="powermgr" path="/system/etc/thermal_config/thermal_service_config.xml" dev="mmcblk0p6" ino=916 scontext=u:r:powermgr:s0 tcontext=u:object_r:system_etc_thermal_file:s0 tclass=file permissive=1
55allow powermgr system_etc_thermal_file:file { getattr read open };
56
57#avc:  denied  { search } for  pid=552 comm="powermgr" name="el0" dev="mmcblk0p11" ino=8 scontext=u:r:powermgr:s0 tcontext=u:object_r:data_service_el0_file:s0 tclass=dir permissive=1
58allow powermgr data_service_el0_file:dir { search write add_name };
59
60#avc:  denied  { read } for  pid=458 comm="powermgr" name="charge" dev="mmcblk0p11" ino=4494 scontext=u:r:powermgr:s0 tcontext=u:object_r:data_service_el0_file:s0 tclass=file permissive=1
61allow powermgr data_service_el0_file:file { create ioctl open read write };
62