Migrate composd to odrefresh-in-vm
Replace startTestCompile with what was startAsyncOdrefresh, and
migrate startStagedApexCompile to work the same way. That means
both of our scheduled jobs will now be using the new mechanism.
Remove some of the now redundant code.
Remove tests that were explicitly running the deprecated form.
Bug: 205750213
Bug: 210998077
Test: atest ComposHostTestCases
Test: Manually trigger both scheduled jobs, observe success
Change-Id: Ie9df53045a852a37330156c76ac25c74db907b46
diff --git a/compos/composd/src/service.rs b/compos/composd/src/service.rs
index 69cf008..093e428 100644
--- a/compos/composd/src/service.rs
+++ b/compos/composd/src/service.rs
@@ -17,7 +17,6 @@
//! Implementation of IIsolatedCompilationService, called from system server when compilation is
//! desired.
-use crate::compilation_task::CompilationTask;
use crate::instance_manager::InstanceManager;
use crate::odrefresh_task::OdrefreshTask;
use android_system_composd::aidl::android::system::composd::{
@@ -62,14 +61,6 @@
check_permissions()?;
to_binder_result(self.do_start_test_compile(callback))
}
-
- fn startAsyncOdrefresh(
- &self,
- callback: &Strong<dyn ICompilationTaskCallback>,
- ) -> binder::Result<Strong<dyn ICompilationTask>> {
- check_permissions()?;
- to_binder_result(self.do_start_async_odrefresh(callback))
- }
}
impl IsolatedCompilationService {
@@ -80,7 +71,9 @@
// TODO: Try to start the current instance with staged APEXes to see if it works?
let comp_os = self.instance_manager.start_pending_instance().context("Starting CompOS")?;
- let task = CompilationTask::start_staged_apex_compile(comp_os, callback)?;
+ // TODO: Write to compos-pending instead
+ let target_dir_name = "test-artifacts".to_owned();
+ let task = OdrefreshTask::start(comp_os, target_dir_name, callback)?;
Ok(BnCompilationTask::new_binder(task, BinderFeatures::default()))
}
@@ -91,17 +84,6 @@
) -> Result<Strong<dyn ICompilationTask>> {
let comp_os = self.instance_manager.start_test_instance().context("Starting CompOS")?;
- let task = CompilationTask::start_test_compile(comp_os, callback)?;
-
- Ok(BnCompilationTask::new_binder(task, BinderFeatures::default()))
- }
-
- fn do_start_async_odrefresh(
- &self,
- callback: &Strong<dyn ICompilationTaskCallback>,
- ) -> Result<Strong<dyn ICompilationTask>> {
- let comp_os = self.instance_manager.start_test_instance().context("Starting CompOS")?;
-
let target_dir_name = "test-artifacts".to_owned();
let task = OdrefreshTask::start(comp_os, target_dir_name, callback)?;