blob: 683d913b6c781bb6bd5e34ae57b0be8f7fd0596b [file] [log] [blame]
Darren Hsu70ae5f42021-02-25 18:02:53 +08001type system_suspend, domain, coredomain, system_suspend_server, system_suspend_internal_server;
Tri Voa5320882019-02-26 16:45:40 -08002
3type system_suspend_exec, system_file_type, exec_type, file_type;
4init_daemon_domain(system_suspend)
5
Darren Hsu70ae5f42021-02-25 18:02:53 +08006# To serve ISuspendControlService.
Tri Voa5320882019-02-26 16:45:40 -08007binder_use(system_suspend)
8add_service(system_suspend, system_suspend_control_service)
9
Kalesh Singh0e903622021-07-20 15:13:38 +000010add_service(system_suspend, hal_system_suspend_service)
11
Tri Voa5320882019-02-26 16:45:40 -080012# Access to /sys/power/{ wakeup_count, state } suspend interface.
13allow system_suspend sysfs_power:file rw_file_perms;
Tri Vo131fa732019-02-07 13:29:39 -080014
Michael Sun9cb662b2020-10-16 07:22:44 +000015# Access to wakeup, suspend stats, and wakeup reasons.
Tri Vo5f1ac022019-11-07 13:37:34 -080016r_dir_file(system_suspend, sysfs_suspend_stats)
17r_dir_file(system_suspend, sysfs_wakeup)
Michael Sun9cb662b2020-10-16 07:22:44 +000018r_dir_file(system_suspend, sysfs_wakeup_reasons)
Tri Voe3e77ed2019-11-12 13:37:03 -080019# To resolve arbitrary sysfs paths from /sys/class/wakeup/* symlinks.
20allow system_suspend sysfs_type:dir search;
Tri Vo5f1ac022019-11-07 13:37:34 -080021
Benjamin Schwartz3e4d97b2020-10-30 13:55:21 -070022# Access to suspend_hal system properties
23get_prop(system_suspend, suspend_prop)
24
Michael Sun666992e2020-10-14 19:49:20 +000025# To call BTAA registered callbacks
26allow system_suspend bluetooth:binder call;
27
Kalesh Singh215751a2020-11-23 19:03:55 -050028# For adding `dumpsys syspend_control` output to bugreport
29allow system_suspend dumpstate:fd use;
30allow system_suspend dumpstate:fifo_file write;
31
Kalesh Singha0a55e02022-12-14 13:02:50 -080032# Allow init to take kernel wakelock and system suspend to
33# remove kenel wakelocks and the capability to access these
34# files
35allow init sysfs_wake_lock:file rw_file_perms;
36allow init self:global_capability2_class_set block_suspend;
37allow system_suspend sysfs_wake_lock:file rw_file_perms;
38allow system_suspend self:global_capability2_class_set block_suspend;
39
Steve Muckle75603e32023-10-03 22:31:22 +000040# Allow init to set /sys/power/sync_on_suspend.
41allow init sysfs_sync_on_suspend:file w_file_perms;
42
Tri Vo131fa732019-02-07 13:29:39 -080043neverallow {
44 domain
45 -atrace # tracing
Michael Sundf54a522020-10-14 00:31:01 +000046 -bluetooth # support Bluetooth activity attribution (BTAA)
Tri Vo131fa732019-02-07 13:29:39 -080047 -dumpstate # bug reports
48 -system_suspend # implements system_suspend_control_service
49 -system_server # configures system_suspend via ISuspendControlService
50 -traceur_app # tracing
51} system_suspend_control_service:service_manager find;