1 /* 2 * Copyright (C) 2021 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 //! Common items used by CompOS server and/or clients 18 19 pub mod binder; 20 pub mod compos_client; 21 pub mod odrefresh; 22 pub mod timeouts; 23 24 /// Special CID indicating "any". 25 pub const VMADDR_CID_ANY: u32 = -1i32 as u32; 26 27 /// VSock port that the CompOS server listens on for RPC binder connections. This should be out of 28 /// future port range (if happens) that microdroid may reserve for system components. 29 pub const COMPOS_VSOCK_PORT: u32 = 6432; 30 31 /// The root directory where the CompOS APEX is mounted (read only). 32 pub const COMPOS_APEX_ROOT: &str = "/apex/com.android.compos"; 33 34 /// The root of the data directory available for private use by the CompOS APEX. 35 pub const COMPOS_DATA_ROOT: &str = "/data/misc/apexdata/com.android.compos"; 36 37 /// The sub-directory where we store information relating to the instance of CompOS used for 38 /// real compilation. 39 pub const CURRENT_INSTANCE_DIR: &str = "current"; 40 41 /// The sub-directory where we store information relating to the instance of CompOS used for 42 /// tests. 43 pub const TEST_INSTANCE_DIR: &str = "test"; 44 45 /// The file that holds the instance image for a CompOS instance. 46 pub const INSTANCE_IMAGE_FILE: &str = "instance.img"; 47 48 /// The file that holds the idsig for the CompOS Payload APK. 49 pub const IDSIG_FILE: &str = "idsig"; 50 51 /// The file that holds the idsig for the build manifest APK (that makes enumerated files from 52 /// /system available in CompOS). 53 pub const IDSIG_MANIFEST_APK_FILE: &str = "idsig_manifest_apk"; 54 55 /// The path within our config APK of our default VM configuration file, used at boot time. 56 pub const DEFAULT_VM_CONFIG_PATH: &str = "assets/vm_config.json"; 57 58 /// The path within our config APK of the VM configuration file we use when compiling staged 59 /// APEXes before reboot. 60 pub const PREFER_STAGED_VM_CONFIG_PATH: &str = "assets/vm_config_staged.json"; 61 62 /// Number of CPUs to run dex2oat (actually the entire compos VM) with 63 pub const DEX2OAT_THREADS_PROP_NAME: &str = "dalvik.vm.boot-dex2oat-threads"; 64 65 /// Set of host-side CPUs to run dex2oat (actually the entire compos VM) on 66 pub const DEX2OAT_CPU_SET_PROP_NAME: &str = "dalvik.vm.boot-dex2oat-cpu-set"; 67