blob: 9a76909b2f4763096fc4cfcb3a9066e3f76aa4c6 [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 Kawamurac532b792025-02-14 15:54:51 +09009set_prop(mmd, mmd_shared_status_prop)
Shintaro Kawamura8e570952025-02-03 20:18:03 +090010set_prop(mmd, mmd_status_prop)
11get_prop(mmd, mmd_prop)
Shintaro Kawamura81c4bae2024-11-22 17:37:03 +090012get_prop(mmd, device_config_mmd_native_prop)
Shintaro Kawamura9444dab2024-11-22 14:05:05 +090013
Hung Nguyen9c7d3062024-11-05 15:50:00 -080014# mmd binder setup
15add_service(mmd, mmd_service)
16binder_use(mmd)
Shintaro Kawamura2712c902024-11-21 11:59:17 +090017
Hung Nguyen0e30a882024-12-02 23:32:48 +000018# Read /proc/swaps
19allow mmd proc_swaps:file r_file_perms;
20
Shintaro Kawamura2712c902024-11-21 11:59:17 +090021# zram sysfs access
22allow mmd sysfs_zram:dir search;
23allow mmd sysfs_zram:file rw_file_perms;
24
25# procfs
26allow mmd proc_meminfo:file r_file_perms;
Hung Nguyen0e30a882024-12-02 23:32:48 +000027
28# mkswap /dev/block/zram command
29allow mmd block_device:dir search;
30allow mmd swap_block_device:blk_file rw_file_perms;
31
32# swapon syscall
33allow mmd self:capability sys_admin;
Shintaro Kawamura6ebb5372025-01-29 15:01:41 +090034
35# Allow mmd to write to statsd socket.
36unix_socket_send(mmd, statsdw, statsd)
Shintaro Kawamura23ec1102025-02-12 14:04:30 +090037# Allow mmd to interact with statsd binder calls for pulled atoms.
38allow mmd stats_service:service_manager find;
39allow mmd statsmanager_service:service_manager find;
40binder_call(mmd, statsd)