Split CompOS interface in two

One service for system server (which will become stable), one for
internal calls from odrefresh (which will probably go away soon).

Test: compos_cmd forced-compile-test
Bug: 199147668
Change-Id: Ia7024e18fe1708eafb673a68b944c3f011715f11
diff --git a/compos/composd/aidl/Android.bp b/compos/composd/aidl/Android.bp
index 8116632..62c1b40 100644
--- a/compos/composd/aidl/Android.bp
+++ b/compos/composd/aidl/Android.bp
@@ -5,7 +5,6 @@
 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: {
@@ -18,7 +17,17 @@
                 "com.android.compos",
             ],
         },
-        ndk: {
+    },
+}
+
+aidl_interface {
+    name: "android.system.composd.internal",
+    srcs: ["android/system/composd/internal/*.aidl"],
+    imports: ["compos_aidl_interface"],
+    // TODO: Make this stable when the APEX becomes updatable.
+    unstable: true,
+    backend: {
+        rust: {
             enabled: true,
             apex_available: [
                 "com.android.compos",
diff --git a/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl b/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
index 3d28894..6b3a6bb 100644
--- a/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
+++ b/compos/composd/aidl/android/system/composd/IIsolatedCompilationService.aidl
@@ -17,8 +17,6 @@
 
 import android.system.composd.ICompilationTask;
 import android.system.composd.ICompilationTaskCallback;
-import com.android.compos.CompilationResult;
-import com.android.compos.FdAnnotation;
 
 interface IIsolatedCompilationService {
     /**
@@ -31,22 +29,4 @@
      * a reference to the ICompilationTask until compilation completes or is cancelled.
      */
     ICompilationTask startTestCompile(ICompilationTaskCallback callback);
-
-    /**
-     * Run dex2oat in the currently running instance of the CompOS VM. This is a simple proxy
-     * to ICompOsService#compile_cmd.
-     *
-     * This method can only be called from odrefresh. If there is no currently running instance
-     * an error is returned.
-     */
-    CompilationResult compile_cmd(in String[] args, in FdAnnotation fd_annotation);
-
-    /**
-     * 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 libcompos_client. If there is no currently running
-     * instance an error is returned.
-     */
-    byte compile(in byte[] marshaledArguments, in FdAnnotation fd_annotation);
 }
diff --git a/compos/composd/aidl/android/system/composd/internal/ICompilationInternal.aidl b/compos/composd/aidl/android/system/composd/internal/ICompilationInternal.aidl
new file mode 100644
index 0000000..182094b
--- /dev/null
+++ b/compos/composd/aidl/android/system/composd/internal/ICompilationInternal.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.system.composd.internal;
+
+import com.android.compos.CompilationResult;
+import com.android.compos.FdAnnotation;
+
+interface ICompilationInternal {
+    /**
+     * Run dex2oat in the currently running instance of the CompOS VM. This is a simple proxy
+     * to ICompOsService#compile_cmd.
+     *
+     * This method can only be called from odrefresh. If there is no currently running instance
+     * an error is returned.
+     */
+    CompilationResult compile_cmd(in String[] args, in FdAnnotation fd_annotation);
+
+    /**
+     * 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 libcompos_client. If there is no currently running
+     * instance an error is returned.
+     */
+    byte compile(in byte[] marshaledArguments, in FdAnnotation fd_annotation);
+}