Start VirtualizationService on demand.
Bug: 183582651
Test: atest VirtualizationTestCases
Change-Id: If6cec89206492cf9818a586d9439ebdb62f27342
diff --git a/vm/src/main.rs b/vm/src/main.rs
index 84f7d18..bdb574c 100644
--- a/vm/src/main.rs
+++ b/vm/src/main.rs
@@ -19,7 +19,7 @@
mod sync;
use android_system_virtualizationservice::aidl::android::system::virtualizationservice::IVirtualizationService::IVirtualizationService;
-use android_system_virtualizationservice::binder::{get_interface, ProcessState, Strong};
+use android_system_virtualizationservice::binder::{wait_for_interface, ProcessState, Strong};
use anyhow::{Context, Error};
use run::command_run;
use std::path::PathBuf;
@@ -58,7 +58,7 @@
// We need to start the thread pool for Binder to work properly, especially link_to_death.
ProcessState::start_thread_pool();
- let service = get_interface(VIRTUALIZATION_SERVICE_BINDER_SERVICE_IDENTIFIER)
+ let service = wait_for_interface(VIRTUALIZATION_SERVICE_BINDER_SERVICE_IDENTIFIER)
.context("Failed to find VirtualizationService")?;
match opt {