blob: 1c0eca17a31522dbe9ac1e40a88f71f01c7db1ef [file] [log] [blame]
Hung Nguyen9c7d3062024-11-05 15:50:00 -08001# mmd memory management daemon
2type mmd, domain;
3typeattribute mmd coredomain;
4type mmd_exec, system_file_type, exec_type, file_type;
5
6init_daemon_domain(mmd)
7
Hung Nguyen28f1da02025-02-04 21:58:58 -08008# Set mmd.enabled_aconfig and zram backing device size.
Shintaro Kawamura8e570952025-02-03 20:18:03 +09009set_prop(mmd, mmd_status_prop)
10get_prop(mmd, mmd_prop)
Shintaro Kawamura81c4bae2024-11-22 17:37:03 +090011get_prop(mmd, device_config_mmd_native_prop)
Shintaro Kawamura9444dab2024-11-22 14:05:05 +090012
Hung Nguyen9c7d3062024-11-05 15:50:00 -080013# mmd binder setup
14add_service(mmd, mmd_service)
15binder_use(mmd)
Shintaro Kawamura2712c902024-11-21 11:59:17 +090016
Hung Nguyen0e30a882024-12-02 23:32:48 +000017# Read /proc/swaps
18allow mmd proc_swaps:file r_file_perms;
19
Shintaro Kawamura2712c902024-11-21 11:59:17 +090020# zram sysfs access
21allow mmd sysfs_zram:dir search;
22allow mmd sysfs_zram:file rw_file_perms;
23
24# procfs
25allow mmd proc_meminfo:file r_file_perms;
Hung Nguyen0e30a882024-12-02 23:32:48 +000026
27# mkswap /dev/block/zram command
28allow mmd block_device:dir search;
29allow mmd swap_block_device:blk_file rw_file_perms;
30
31# swapon syscall
32allow mmd self:capability sys_admin;
Shintaro Kawamura6ebb5372025-01-29 15:01:41 +090033
34# Allow mmd to write to statsd socket.
35unix_socket_send(mmd, statsdw, statsd)
Shintaro Kawamura23ec1102025-02-12 14:04:30 +090036# Allow mmd to interact with statsd binder calls for pulled atoms.
37allow mmd stats_service:service_manager find;
38allow mmd statsmanager_service:service_manager find;
39binder_call(mmd, statsd)