1# Copyright (C) 2023 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# A service that handles dexopt. See art/artd/README.md. It's a lazy service
16# that is started and stopped dynamically as needed.
17service artd /apex/com.android.art/bin/artd
18    interface aidl artd
19    disabled  # Prevents the service from automatically starting at boot.
20    oneshot  # Prevents the service from automatically restarting each time it is stopped.
21    class core
22    user artd
23    group artd
24    capabilities DAC_OVERRIDE DAC_READ_SEARCH FOWNER CHOWN
25
26# Same as above, but for Pre-reboot Dexopt. It runs in a chroot environment that
27# is set up by dexopt_chroot_setup. It's a lazy service that is started and
28# stopped dynamically as needed.
29service artd_pre_reboot /apex/com.android.art/bin/art_exec \
30        --chroot=/mnt/pre_reboot_dexopt/chroot \
31        --process-name-suffix="Pre-reboot Dexopt chroot" \
32        -- \
33        /apex/com.android.art/bin/artd \
34        --pre-reboot
35    interface aidl artd_pre_reboot
36    disabled  # Prevents the service from automatically starting at boot.
37    oneshot  # Prevents the service from automatically restarting each time it is stopped.
38    class core
39    user artd
40    group artd
41    capabilities DAC_OVERRIDE DAC_READ_SEARCH FOWNER CHOWN SYS_CHROOT SYS_ADMIN
42
43# A service that sets up the chroot environment for Pre-reboot Dexopt. See
44# art/dexopt_chroot_setup/README.md. It's a lazy service that is started and
45# stopped dynamically as needed.
46service dexopt_chroot_setup /apex/com.android.art/bin/dexopt_chroot_setup
47    interface aidl dexopt_chroot_setup
48    disabled  # Prevents the service from automatically starting at boot.
49    oneshot  # Prevents the service from automatically restarting each time it is stopped.
50    class core
51    user artd
52    group artd
53    capabilities DAC_OVERRIDE DAC_READ_SEARCH SYS_CHROOT SYS_ADMIN
54
55# Run at boot in Android U and later.
56service art_boot /apex/com.android.art/bin/art_boot
57    disabled  # Started explicitly from system/core/rootdir/init.rc
58    oneshot
59    class core
60    user root
61