1service audioserver /system/bin/audioserver
2    class core
3    user audioserver
4    # media gid needed for /dev/fm (radio) and for /data/misc/media (tee)
5    group audio camera drmrpc media mediadrm net_bt net_bt_admin net_bw_acct wakelock
6    capabilities BLOCK_SUSPEND
7    # match rtprio cur / max with sensor service as we handle AR/VR HID sensor data.
8    rlimit rtprio 10 10
9    ioprio rt 4
10    task_profiles ProcessCapacityHigh HighPerformance
11    onrestart restart vendor.audio-hal
12    onrestart restart vendor.audio-hal-aidl
13    onrestart restart vendor.audio-effect-hal-aidl
14    onrestart restart vendor.audio-hal-4-0-msd
15    onrestart restart audio_proxy_service
16
17on property:vts.native_server.on=1
18    stop audioserver
19on property:vts.native_server.on=0
20    start audioserver
21
22on property:init.svc.audioserver=stopped
23    stop vendor.audio-hal
24    stop vendor.audio-hal-aidl
25    stop vendor.audio-effect-hal-aidl
26    stop vendor.audio-hal-4-0-msd
27    stop audio_proxy_service
28    # See b/155364397. Need to have HAL service running for VTS.
29    # Can't use 'restart' because then HAL service would restart
30    # audioserver bringing it back into running state.
31    start vendor.audio-hal
32    start vendor.audio-hal-aidl
33    start vendor.audio-effect-hal-aidl
34    start vendor.audio-hal-4-0-msd
35    start audio_proxy_service
36
37on property:init.svc.audioserver=running
38    start vendor.audio-hal
39    start vendor.audio-hal-aidl
40    start vendor.audio-effect-hal-aidl
41    start vendor.audio-hal-4-0-msd
42    start audio_proxy_service
43
44on property:sys.audio.restart.hal=1
45    # See b/159966243. Avoid restart loop between audioserver and HAL.
46    # Keep the original service names for backward compatibility
47    stop vendor.audio-hal
48    stop vendor.audio-hal-aidl
49    stop vendor.audio-effect-hal-aidl
50    stop vendor.audio-hal-4-0-msd
51    stop audio_proxy_service
52    start vendor.audio-hal
53    start vendor.audio-hal-aidl
54    start vendor.audio-effect-hal-aidl
55    start vendor.audio-hal-4-0-msd
56    start audio_proxy_service
57    # reset the property
58    setprop sys.audio.restart.hal 0
59
60on init
61    mkdir /dev/socket/audioserver 0775 audioserver audioserver
62