1 /*
2  * Copyright (C) 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.server.art;
18 
19 /** @hide */
20 interface IDexoptChrootSetup {
21     const @utf8InCpp String PRE_REBOOT_DEXOPT_DIR = "/mnt/pre_reboot_dexopt";
22     const @utf8InCpp String CHROOT_DIR = PRE_REBOOT_DEXOPT_DIR + "/chroot";
23 
24     /**
25      * Sets up the chroot environment. All files in chroot, except apexes and the linker config, are
26      * accessible after this method is called.
27      *
28      * @param otaSlot The slot that contains the OTA update, "_a" or "_b", or null for a Mainline
29      *         update.
30      * @param mapSnapshotsForOta Whether to map/unmap snapshots. Only applicable to an OTA update.
31      */
setUp(@ullable @tf8InCpp String otaSlot, boolean mapSnapshotsForOta)32     void setUp(@nullable @utf8InCpp String otaSlot, boolean mapSnapshotsForOta);
33 
34     /**
35      * Initializes the chroot environment. Can only be called after {@link #setUp}. Apexes and
36      * the linker config in chroot are accessible, and binaries are executable in chroot, after
37      * this method is called.
38      */
init()39     void init();
40 
41     /** Tears down the chroot environment. */
tearDown()42     void tearDown();
43 }
44