Keystore 2.0: Rename KeystoreUserManagement -> KeystoreMaintenance
Test: N/A
Change-Id: I92a508db6d22ee41f34e7a4e5e57a607f0108403
diff --git a/keystore2/src/keystore2_main.rs b/keystore2/src/keystore2_main.rs
index 7739f5e..51c78b1 100644
--- a/keystore2/src/keystore2_main.rs
+++ b/keystore2/src/keystore2_main.rs
@@ -19,7 +19,7 @@
use keystore2::globals::ENFORCEMENTS;
use keystore2::remote_provisioning::RemoteProvisioningService;
use keystore2::service::KeystoreService;
-use keystore2::user_manager::UserManager;
+use keystore2::user_manager::Maintenance;
use log::{error, info};
use std::{panic, path::Path, sync::mpsc::channel};
use vpnprofilestore::VpnProfileStore;
@@ -28,7 +28,7 @@
static APC_SERVICE_NAME: &str = "android.security.apc";
static AUTHORIZATION_SERVICE_NAME: &str = "android.security.authorization";
static REMOTE_PROVISIONING_SERVICE_NAME: &str = "android.security.remoteprovisioning";
-static USER_MANAGER_SERVICE_NAME: &str = "android.security.usermanager";
+static USER_MANAGER_SERVICE_NAME: &str = "android.security.maintenance";
static VPNPROFILESTORE_SERVICE_NAME: &str = "android.security.vpnprofilestore";
/// Keystore 2.0 takes one argument which is a path indicating its designated working directory.
@@ -100,10 +100,10 @@
panic!("Failed to register service {} because of {:?}.", AUTHORIZATION_SERVICE_NAME, e);
});
- let usermanager_service = UserManager::new_native_binder().unwrap_or_else(|e| {
+ let maintenance_service = Maintenance::new_native_binder().unwrap_or_else(|e| {
panic!("Failed to create service {} because of {:?}.", USER_MANAGER_SERVICE_NAME, e);
});
- binder::add_service(USER_MANAGER_SERVICE_NAME, usermanager_service.as_binder()).unwrap_or_else(
+ binder::add_service(USER_MANAGER_SERVICE_NAME, maintenance_service.as_binder()).unwrap_or_else(
|e| {
panic!("Failed to register service {} because of {:?}.", USER_MANAGER_SERVICE_NAME, e);
},
diff --git a/keystore2/src/user_manager.rs b/keystore2/src/user_manager.rs
index 3c393c5..b84cb82 100644
--- a/keystore2/src/user_manager.rs
+++ b/keystore2/src/user_manager.rs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//! This module implements IKeystoreUserManager AIDL interface.
+//! This module implements IKeystoreMaintenance AIDL interface.
use crate::error::map_or_log_err;
use crate::error::Error as KeystoreError;
@@ -20,10 +20,10 @@
use crate::permission::KeystorePerm;
use crate::super_key::UserState;
use crate::utils::check_keystore_permission;
-use android_security_usermanager::aidl::android::security::usermanager::IKeystoreUserManager::{
- BnKeystoreUserManager, IKeystoreUserManager,
+use android_security_maintenance::aidl::android::security::maintenance::IKeystoreMaintenance::{
+ BnKeystoreMaintenance, IKeystoreMaintenance,
};
-use android_security_usermanager::binder::{Interface, Result as BinderResult};
+use android_security_maintenance::binder::{Interface, Result as BinderResult};
use android_system_keystore2::aidl::android::system::keystore2::Domain::Domain;
use android_system_keystore2::aidl::android::system::keystore2::ResponseCode::ResponseCode;
use anyhow::{Context, Result};
@@ -31,12 +31,12 @@
/// This struct is defined to implement the aforementioned AIDL interface.
/// As of now, it is an empty struct.
-pub struct UserManager;
+pub struct Maintenance;
-impl UserManager {
+impl Maintenance {
/// Create a new instance of Keystore User Manager service.
- pub fn new_native_binder() -> Result<Strong<dyn IKeystoreUserManager>> {
- let result = BnKeystoreUserManager::new_binder(Self);
+ pub fn new_native_binder() -> Result<Strong<dyn IKeystoreMaintenance>> {
+ let result = BnKeystoreMaintenance::new_binder(Self);
result.as_binder().set_requesting_sid(true);
Ok(result)
}
@@ -99,9 +99,9 @@
}
}
-impl Interface for UserManager {}
+impl Interface for Maintenance {}
-impl IKeystoreUserManager for UserManager {
+impl IKeystoreMaintenance for Maintenance {
fn onUserPasswordChanged(&self, user_id: i32, password: Option<&[u8]>) -> BinderResult<()> {
map_or_log_err(Self::on_user_password_changed(user_id, password), Ok)
}