Call odrefresh in VM from composd
composd needs to prepare the directory, run a fd_server, etc. then
request to run odrefresh in the VM.
`FdServerConfig` and `FdServer` are introduced to make starting a
fd_server from composd easier.
Also, add a testing command in composd_cmd.
Bug: 205750213
Test: atest ComposHostTestCases
Test: With some local hacks in ART, with SELinux disabled in the VM,
odrefresh completed with exit code 80 and output files that
look normal (at least sizes are).
Change-Id: I52c9d1ad369eea6d423831adb42087a3bcf30d66
diff --git a/compos/composd/src/util.rs b/compos/composd/src/util.rs
index 091fb15..54d7751 100644
--- a/compos/composd/src/util.rs
+++ b/compos/composd/src/util.rs
@@ -18,8 +18,9 @@
use anyhow::Result;
use binder_common::new_binder_service_specific_error;
use log::error;
+use std::fmt::Debug;
-pub fn to_binder_result<T>(result: Result<T>) -> BinderResult<T> {
+pub fn to_binder_result<T, E: Debug>(result: Result<T, E>) -> BinderResult<T> {
result.map_err(|e| {
let message = format!("{:?}", e);
error!("Returning binder error: {}", &message);