Run odrefresh in composd

This is far from finished, but it is at least started. This currently
fails when pvm_exec tries to create a vsock; instead it will need to
request one from composd.

Test: adb shell apex/com.android.compos/bin/composd_cmd
Bug: 186126194
Change-Id: Ic193ddd3835be3daf70b15e78c56c0ccb98e7a1f
diff --git a/compos/common/compos_client.rs b/compos/common/compos_client.rs
index 80cf05a..03cc331 100644
--- a/compos/common/compos_client.rs
+++ b/compos/common/compos_client.rs
@@ -47,7 +47,6 @@
 pub struct VmInstance {
     #[allow(dead_code)] // Keeps the vm alive even if we don`t touch it
     vm: Strong<dyn IVirtualMachine>,
-    #[allow(dead_code)] // Likely to be useful
     cid: i32,
 }
 
@@ -132,6 +131,11 @@
 
         FromIBinder::try_from(ibinder).context("Connecting to CompOS service")
     }
+
+    /// Return the CID of the VM.
+    pub fn cid(&self) -> i32 {
+        self.cid
+    }
 }
 
 struct VsockFactory<'a> {
diff --git a/compos/common/lib.rs b/compos/common/lib.rs
index 081f086..6bea62c 100644
--- a/compos/common/lib.rs
+++ b/compos/common/lib.rs
@@ -27,3 +27,20 @@
 
 /// The root of the  data directory available for private use by the CompOS APEX.
 pub const COMPOS_DATA_ROOT: &str = "/data/misc/apexdata/com.android.compos";
+
+/// The sub-directory where we store information relating to the pending instance
+/// of CompOS (based on staged APEXes).
+pub const PENDING_DIR: &str = "pending";
+
+/// The sub-directory where we store information relating to the current instance
+/// of CompOS (based on active APEXes).
+pub const CURRENT_DIR: &str = "current";
+
+/// The file that holds the encrypted private key for a CompOS instance.
+pub const PRIVATE_KEY_BLOB_FILE: &str = "key.blob";
+
+/// The file that holds the public key for a CompOS instance.
+pub const PUBLIC_KEY_FILE: &str = "key.pubkey";
+
+/// The file that holds the instance image for a CompOS instance.
+pub const INSTANCE_IMAGE_FILE: &str = "instance.img";