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/composd_main.rs b/compos/composd/src/composd_main.rs
index 57f64a5..67b5974 100644
--- a/compos/composd/src/composd_main.rs
+++ b/compos/composd/src/composd_main.rs
@@ -35,8 +35,10 @@
use std::sync::Arc;
fn try_main() -> Result<()> {
+ let debuggable = env!("TARGET_BUILD_VARIANT") != "user";
+ let log_level = if debuggable { log::Level::Debug } else { log::Level::Info };
android_logger::init_once(
- android_logger::Config::default().with_tag("composd").with_min_level(log::Level::Info),
+ android_logger::Config::default().with_tag("composd").with_min_level(log_level),
);
ProcessState::start_thread_pool();