Migrate to the librustutils system property bindings.
Bug: 182498247
Test: Build
Change-Id: Ic16033d7f5e302a3cb7e591a0fa2ae403755fc2e
diff --git a/keystore2/src/metrics_store.rs b/keystore2/src/metrics_store.rs
index 4634da1..741d65e 100644
--- a/keystore2/src/metrics_store.rs
+++ b/keystore2/src/metrics_store.rs
@@ -46,10 +46,10 @@
};
use anyhow::{Context, Result};
use lazy_static::lazy_static;
+use rustutils::system_properties::PropertyWatcherError;
use std::collections::HashMap;
use std::sync::Mutex;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
-use system_properties::PropertyWatcherError;
// Note: Crash events are recorded at keystore restarts, based on the assumption that keystore only
// gets restarted after a crash, during a boot cycle.
@@ -626,7 +626,8 @@
}
};
- if let Err(e) = system_properties::write(KEYSTORE_CRASH_COUNT_PROPERTY, &new_count.to_string())
+ if let Err(e) =
+ rustutils::system_properties::write(KEYSTORE_CRASH_COUNT_PROPERTY, &new_count.to_string())
{
log::error!(
concat!(
@@ -640,7 +641,7 @@
/// Read the system property: keystore.crash_count.
pub fn read_keystore_crash_count() -> Result<i32> {
- system_properties::read("keystore.crash_count")
+ rustutils::system_properties::read("keystore.crash_count")
.context("In read_keystore_crash_count: Failed read property.")?
.parse::<i32>()
.map_err(std::convert::Into::into)