Get odrefresh in composd working.
composd now keeps track of the running instance of the CompOS VM and
will proxy compilation requests to it. (I was going to return an
ICompOsService, but mixing RPC and normal binder isn't allowed.) This
avoids giving odrefresh any access to vsock_socket at all.
pvm_exec now connects to composd rather than directly to the VM if a
magic CID value is specified. (It also logs errors more volubly, which
was helpful.)
Modify pvm_exec
Bug: 186126194
Test: Run composd_cmd, artifacts generated
Change-Id: If80cf53287bd1bac9c97c992da7e121b1a64aaaa
diff --git a/compos/composd/aidl/Android.bp b/compos/composd/aidl/Android.bp
index 90c0de0..0352001 100644
--- a/compos/composd/aidl/Android.bp
+++ b/compos/composd/aidl/Android.bp
@@ -5,6 +5,7 @@
aidl_interface {
name: "android.system.composd",
srcs: ["android/system/composd/*.aidl"],
+ imports: ["compos_aidl_interface"],
// TODO: Make this stable when the APEX becomes updatable.
unstable: true,
backend: {
diff --git a/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl b/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
index 9240bc6..5ff72fe 100644
--- a/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
+++ b/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
@@ -15,7 +15,19 @@
*/
package android.system.composd;
+import com.android.compos.CompilationResult;
+import com.android.compos.FdAnnotation;
+
interface IIsolatedCompilationService {
- /// Run "odrefresh --force-compile" in CompOS
+ /** Run "odrefresh --force-compile" in CompOS. */
void runForcedCompile();
+
+ /**
+ * Run dex2oat in the currently running instance of the CompOS VM. This is a simple proxy
+ * to ICompOsService#compile.
+ *
+ * This method can only be called from odrefresh. If there is no currently running instance
+ * an error is returned.
+ */
+ CompilationResult compile(in String[] args, in FdAnnotation fd_annotation);
}