diff --git a/keystore2/Android.bp b/keystore2/Android.bp index 64636ac7..fe0a11a8 100644 --- a/keystore2/Android.bp +++ b/keystore2/Android.bp @@ -54,7 +54,7 @@ rust_defaults { "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 4634da11..741d65e0 100644 --- a/keystore2/src/metrics_store.rs +++ b/keystore2/src/metrics_store.rs @@ -46,10 +46,10 @@ use android_security_metrics::aidl::android::security::metrics::{ }; 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 @@ pub fn update_keystore_crash_sysprop() { } }; - 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 @@ pub fn update_keystore_crash_sysprop() { /// Read the system property: keystore.crash_count. pub fn read_keystore_crash_count() -> Result { - system_properties::read("keystore.crash_count") + rustutils::system_properties::read("keystore.crash_count") .context("In read_keystore_crash_count: Failed read property.")? .parse::() .map_err(std::convert::Into::into) diff --git a/keystore2/src/super_key.rs b/keystore2/src/super_key.rs index 4b71bb5f..a1e4c488 100644 --- a/keystore2/src/super_key.rs +++ b/keystore2/src/super_key.rs @@ -46,13 +46,13 @@ use keystore2_crypto::{ 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