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/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs
index ebb01b3..7e0c634 100644
--- a/virtualizationservice/src/aidl.rs
+++ b/virtualizationservice/src/aidl.rs
@@ -868,7 +868,7 @@
/// a system property so that restart of virtualizationservice doesn't reuse CID while the host
/// Android is up.
fn next_cid() -> Result<Cid> {
- let next = if let Ok(val) = system_properties::read(SYSPROP_LAST_CID) {
+ let next = if let Some(val) = system_properties::read(SYSPROP_LAST_CID)? {
if let Ok(num) = val.parse::<u32>() {
num.checked_add(1).ok_or_else(|| anyhow!("run out of CID"))?
} else {