Migrate to the librustutils system property bindings.
Bug: 182498247
Test: Build
Change-Id: Ic16033d7f5e302a3cb7e591a0fa2ae403755fc2e
diff --git a/keystore2/Android.bp b/keystore2/Android.bp
index 64636ac..fe0a11a 100644
--- a/keystore2/Android.bp
+++ b/keystore2/Android.bp
@@ -54,7 +54,7 @@
"liblog_rust",
"librand",
"librusqlite",
- "libsystem_properties-rust",
+ "librustutils",
"libthiserror",
],
shared_libs: [
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)
diff --git a/keystore2/src/super_key.rs b/keystore2/src/super_key.rs
index 4b71bb5..a1e4c48 100644
--- a/keystore2/src/super_key.rs
+++ b/keystore2/src/super_key.rs
@@ -46,13 +46,13 @@
aes_gcm_decrypt, aes_gcm_encrypt, generate_aes256_key, generate_salt, Password, ZVec,
AES_256_KEY_LENGTH,
};
+use rustutils::system_properties::PropertyWatcher;
use std::{
collections::HashMap,
sync::Arc,
sync::{Mutex, Weak},
};
use std::{convert::TryFrom, ops::Deref};
-use system_properties::PropertyWatcher;
const MAX_MAX_BOOT_LEVEL: usize = 1_000_000_000;
/// Allow up to 15 seconds between the user unlocking using a biometric, and the auth