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 | |
Shintaro Kawamura | 9444dab | 2024-11-22 14:05:05 +0900 | [diff] [blame] | 8 | # Set mmd.enabled_aconfig properties. |
Shintaro Kawamura | 8e57095 | 2025-02-03 20:18:03 +0900 | [diff] [blame] | 9 | set_prop(mmd, mmd_status_prop) |
| 10 | get_prop(mmd, mmd_prop) |
Shintaro Kawamura | 81c4bae | 2024-11-22 17:37:03 +0900 | [diff] [blame] | 11 | get_prop(mmd, device_config_mmd_native_prop) |
Shintaro Kawamura | 9444dab | 2024-11-22 14:05:05 +0900 | [diff] [blame] | 12 | |
Hung Nguyen | 9c7d306 | 2024-11-05 15:50:00 -0800 | [diff] [blame] | 13 | # mmd binder setup |
| 14 | add_service(mmd, mmd_service) |
| 15 | binder_use(mmd) |
Shintaro Kawamura | 2712c90 | 2024-11-21 11:59:17 +0900 | [diff] [blame] | 16 | |
Hung Nguyen | 0e30a88 | 2024-12-02 23:32:48 +0000 | [diff] [blame] | 17 | # Read /proc/swaps |
| 18 | allow mmd proc_swaps:file r_file_perms; |
| 19 | |
Shintaro Kawamura | 2712c90 | 2024-11-21 11:59:17 +0900 | [diff] [blame] | 20 | # zram sysfs access |
| 21 | allow mmd sysfs_zram:dir search; |
| 22 | allow mmd sysfs_zram:file rw_file_perms; |
| 23 | |
| 24 | # procfs |
| 25 | allow mmd proc_meminfo:file r_file_perms; |
Hung Nguyen | 0e30a88 | 2024-12-02 23:32:48 +0000 | [diff] [blame] | 26 | |
| 27 | # mkswap /dev/block/zram command |
| 28 | allow mmd block_device:dir search; |
| 29 | allow mmd swap_block_device:blk_file rw_file_perms; |
| 30 | |
| 31 | # swapon syscall |
| 32 | allow mmd self:capability sys_admin; |
Shintaro Kawamura | 6ebb537 | 2025-01-29 15:01:41 +0900 | [diff] [blame] | 33 | |
| 34 | # Allow mmd to write to statsd socket. |
| 35 | unix_socket_send(mmd, statsdw, statsd) |