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/src/service.rs b/compos/composd/src/service.rs
index 4d9dc58..d9963d1 100644
--- a/compos/composd/src/service.rs
+++ b/compos/composd/src/service.rs
@@ -29,17 +29,16 @@
     self, BinderFeatures, ExceptionCode, Interface, Status, Strong, ThreadState,
 };
 use anyhow::{Context, Result};
-use binder_common::new_binder_service_specific_error;
-use compos_aidl_interface::aidl::com::android::compos::{
-    CompilationResult::CompilationResult, FdAnnotation::FdAnnotation,
-};
 use rustutils::users::{AID_ROOT, AID_SYSTEM};
+use std::sync::Arc;
 
 pub struct IsolatedCompilationService {
-    instance_manager: InstanceManager,
+    instance_manager: Arc<InstanceManager>,
 }
 
-pub fn new_binder(instance_manager: InstanceManager) -> Strong<dyn IIsolatedCompilationService> {
+pub fn new_binder(
+    instance_manager: Arc<InstanceManager>,
+) -> Strong<dyn IIsolatedCompilationService> {
     let service = IsolatedCompilationService { instance_manager };
     BnIsolatedCompilationService::new_binder(service, BinderFeatures::default())
 }
@@ -58,23 +57,6 @@
         }
         to_binder_result(self.do_start_test_compile(callback))
     }
-
-    fn compile_cmd(
-        &self,
-        args: &[String],
-        fd_annotation: &FdAnnotation,
-    ) -> binder::Result<CompilationResult> {
-        let calling_uid = ThreadState::get_calling_uid();
-        // This should only be called by odrefresh, which runs as root
-        if calling_uid != AID_ROOT {
-            return Err(Status::new_exception(ExceptionCode::SECURITY, None));
-        }
-        to_binder_result(self.do_compile_cmd(args, fd_annotation))
-    }
-
-    fn compile(&self, _marshaled: &[u8], _fd_annotation: &FdAnnotation) -> binder::Result<i8> {
-        Err(new_binder_service_specific_error(-1, "Not yet implemented"))
-    }
 }
 
 impl IsolatedCompilationService {
@@ -88,13 +70,4 @@
 
         Ok(BnCompilationTask::new_binder(task, BinderFeatures::default()))
     }
-
-    fn do_compile_cmd(
-        &self,
-        args: &[String],
-        fd_annotation: &FdAnnotation,
-    ) -> Result<CompilationResult> {
-        let compos = self.instance_manager.get_running_service()?;
-        compos.compile_cmd(args, fd_annotation).context("Compiling")
-    }
 }