Migrate to reading properties as bools
Use the bool parsing from librustutils rather than manual parsing of the
raw property value.
Test: atest MicrodroidTestApp
Change-Id: I20e9dc8403ec0928ffab66252f2ae016b4a26fe9
diff --git a/microdroid_manager/src/main.rs b/microdroid_manager/src/main.rs
index 3d145ee..064933d 100644
--- a/microdroid_manager/src/main.rs
+++ b/microdroid_manager/src/main.rs
@@ -471,8 +471,7 @@
let mut prop = PropertyWatcher::new(APEX_CONFIG_DONE_PROP)?;
loop {
prop.wait()?;
- let val = system_properties::read(APEX_CONFIG_DONE_PROP)?;
- if val == "true" {
+ if system_properties::read_bool(APEX_CONFIG_DONE_PROP, false)? {
break;
}
}
@@ -542,7 +541,7 @@
// Start logging if enabled
// TODO(b/200914564) set filterspec if debug_level is app_only
- if system_properties::read(LOGD_ENABLED_PROP)? == "1" {
+ if system_properties::read_bool(LOGD_ENABLED_PROP, false)? {
system_properties::write("ctl.start", "seriallogging")?;
}