Hung Nguyen | 9c7d306 | 2024-11-05 15:50:00 -0800 | [diff] [blame] | 1 | # mmd memory management daemon |
| 2 | type mmd, domain; |
| 3 | typeattribute mmd coredomain; |
| 4 | type mmd_exec, system_file_type, exec_type, file_type; |
| 5 | |
| 6 | init_daemon_domain(mmd) |
| 7 | |
Hung Nguyen | 28f1da0 | 2025-02-04 21:58:58 -0800 | [diff] [blame] | 8 | # Set mmd.enabled_aconfig and zram backing device size. |
Shintaro Kawamura | c532b79 | 2025-02-14 15:54:51 +0900 | [diff] [blame] | 9 | set_prop(mmd, mmd_shared_status_prop) |
Shintaro Kawamura | 8e57095 | 2025-02-03 20:18:03 +0900 | [diff] [blame] | 10 | set_prop(mmd, mmd_status_prop) |
| 11 | get_prop(mmd, mmd_prop) |
Shintaro Kawamura | 81c4bae | 2024-11-22 17:37:03 +0900 | [diff] [blame] | 12 | get_prop(mmd, device_config_mmd_native_prop) |
Shintaro Kawamura | 9444dab | 2024-11-22 14:05:05 +0900 | [diff] [blame] | 13 | |
Hung Nguyen | 9c7d306 | 2024-11-05 15:50:00 -0800 | [diff] [blame] | 14 | # mmd binder setup |
| 15 | add_service(mmd, mmd_service) |
| 16 | binder_use(mmd) |
Shintaro Kawamura | 2712c90 | 2024-11-21 11:59:17 +0900 | [diff] [blame] | 17 | |
Hung Nguyen | 0e30a88 | 2024-12-02 23:32:48 +0000 | [diff] [blame] | 18 | # Read /proc/swaps |
| 19 | allow mmd proc_swaps:file r_file_perms; |
| 20 | |
Shintaro Kawamura | 2712c90 | 2024-11-21 11:59:17 +0900 | [diff] [blame] | 21 | # zram sysfs access |
| 22 | allow mmd sysfs_zram:dir search; |
| 23 | allow mmd sysfs_zram:file rw_file_perms; |
| 24 | |
| 25 | # procfs |
| 26 | allow mmd proc_meminfo:file r_file_perms; |
Hung Nguyen | 0e30a88 | 2024-12-02 23:32:48 +0000 | [diff] [blame] | 27 | |
| 28 | # mkswap /dev/block/zram command |
| 29 | allow mmd block_device:dir search; |
| 30 | allow mmd swap_block_device:blk_file rw_file_perms; |
| 31 | |
| 32 | # swapon syscall |
| 33 | allow mmd self:capability sys_admin; |
Shintaro Kawamura | 6ebb537 | 2025-01-29 15:01:41 +0900 | [diff] [blame] | 34 | |
| 35 | # Allow mmd to write to statsd socket. |
| 36 | unix_socket_send(mmd, statsdw, statsd) |
Shintaro Kawamura | 23ec110 | 2025-02-12 14:04:30 +0900 | [diff] [blame] | 37 | # Allow mmd to interact with statsd binder calls for pulled atoms. |
| 38 | allow mmd stats_service:service_manager find; |
| 39 | allow mmd statsmanager_service:service_manager find; |
| 40 | binder_call(mmd, statsd) |