Update to improved system_properties API.
We'll now return an error if there is an actual error reading the
property, rather than treating it the same as the property not being
set.
Bug: 217728265
Test: mm
Change-Id: I81f22d9ed07443b094f9a64a0737f4d24a2afe15
diff --git a/compos/common/timeouts.rs b/compos/common/timeouts.rs
index c86ae34..e6cc430 100644
--- a/compos/common/timeouts.rs
+++ b/compos/common/timeouts.rs
@@ -35,8 +35,11 @@
/// Whether the current platform requires extra time for operations inside a VM.
pub fn need_extra_time() -> Result<bool> {
// Nested virtualization is slow. Check if we are running on vsoc as a proxy for this.
- let value = system_properties::read("ro.build.product")?;
- Ok(value == "vsoc_x86_64" || value == "vsoc_x86")
+ if let Some(value) = system_properties::read("ro.build.product")? {
+ Ok(value == "vsoc_x86_64" || value == "vsoc_x86")
+ } else {
+ Ok(false)
+ }
}
/// Return the timeouts that are appropriate on the current platform.