Tri Vo | a532088 | 2019-02-26 16:45:40 -0800 | [diff] [blame] | 1 | type system_suspend, domain, coredomain, system_suspend_server; |
| 2 | |
| 3 | type system_suspend_exec, system_file_type, exec_type, file_type; |
| 4 | init_daemon_domain(system_suspend) |
| 5 | |
Michael Sun | 6445f19 | 2020-11-02 23:54:21 +0000 | [diff] [blame] | 6 | # To serve ISuspendControlService and ISuspendControlServiceInternal. |
Tri Vo | a532088 | 2019-02-26 16:45:40 -0800 | [diff] [blame] | 7 | binder_use(system_suspend) |
Michael Sun | 6445f19 | 2020-11-02 23:54:21 +0000 | [diff] [blame] | 8 | add_service(system_suspend, system_suspend_control_internal_service) |
Tri Vo | a532088 | 2019-02-26 16:45:40 -0800 | [diff] [blame] | 9 | add_service(system_suspend, system_suspend_control_service) |
| 10 | |
| 11 | # Access to /sys/power/{ wakeup_count, state } suspend interface. |
| 12 | allow system_suspend sysfs_power:file rw_file_perms; |
Tri Vo | 131fa73 | 2019-02-07 13:29:39 -0800 | [diff] [blame] | 13 | |
Michael Sun | 9cb662b | 2020-10-16 07:22:44 +0000 | [diff] [blame] | 14 | # Access to wakeup, suspend stats, and wakeup reasons. |
Tri Vo | 5f1ac02 | 2019-11-07 13:37:34 -0800 | [diff] [blame] | 15 | r_dir_file(system_suspend, sysfs_suspend_stats) |
| 16 | r_dir_file(system_suspend, sysfs_wakeup) |
Michael Sun | 9cb662b | 2020-10-16 07:22:44 +0000 | [diff] [blame] | 17 | r_dir_file(system_suspend, sysfs_wakeup_reasons) |
Tri Vo | e3e77ed | 2019-11-12 13:37:03 -0800 | [diff] [blame] | 18 | # To resolve arbitrary sysfs paths from /sys/class/wakeup/* symlinks. |
| 19 | allow system_suspend sysfs_type:dir search; |
Tri Vo | 5f1ac02 | 2019-11-07 13:37:34 -0800 | [diff] [blame] | 20 | |
Benjamin Schwartz | 3e4d97b | 2020-10-30 13:55:21 -0700 | [diff] [blame] | 21 | # Access to suspend_hal system properties |
| 22 | get_prop(system_suspend, suspend_prop) |
| 23 | |
Michael Sun | 666992e | 2020-10-14 19:49:20 +0000 | [diff] [blame] | 24 | # To call BTAA registered callbacks |
| 25 | allow system_suspend bluetooth:binder call; |
| 26 | |
Kalesh Singh | 215751a | 2020-11-23 19:03:55 -0500 | [diff] [blame^] | 27 | # For adding `dumpsys syspend_control` output to bugreport |
| 28 | allow system_suspend dumpstate:fd use; |
| 29 | allow system_suspend dumpstate:fifo_file write; |
| 30 | |
Tri Vo | 131fa73 | 2019-02-07 13:29:39 -0800 | [diff] [blame] | 31 | neverallow { |
| 32 | domain |
| 33 | -atrace # tracing |
Michael Sun | 6445f19 | 2020-11-02 23:54:21 +0000 | [diff] [blame] | 34 | -dumpstate # bug reports |
| 35 | -system_suspend # implements system_suspend_control_internal_service |
| 36 | -system_server # configures system_suspend via ISuspendControlServiceInternal |
| 37 | -traceur_app # tracing |
| 38 | } system_suspend_control_internal_service:service_manager find; |
| 39 | |
| 40 | neverallow { |
| 41 | domain |
| 42 | -atrace # tracing |
Michael Sun | df54a52 | 2020-10-14 00:31:01 +0000 | [diff] [blame] | 43 | -bluetooth # support Bluetooth activity attribution (BTAA) |
Tri Vo | 131fa73 | 2019-02-07 13:29:39 -0800 | [diff] [blame] | 44 | -dumpstate # bug reports |
| 45 | -system_suspend # implements system_suspend_control_service |
| 46 | -system_server # configures system_suspend via ISuspendControlService |
| 47 | -traceur_app # tracing |
| 48 | } system_suspend_control_service:service_manager find; |