Keystore 2.0: Rename KeystoreUserManagement -> KeystoreMaintenance
Test: N/A
Change-Id: I92a508db6d22ee41f34e7a4e5e57a607f0108403
diff --git a/keystore2/Android.bp b/keystore2/Android.bp
index d480244..a43b5bd 100644
--- a/keystore2/Android.bp
+++ b/keystore2/Android.bp
@@ -32,8 +32,8 @@
"android.security.apc-rust",
"android.security.authorization-rust",
"android.security.compat-rust",
+ "android.security.maintenance-rust",
"android.security.remoteprovisioning-rust",
- "android.security.usermanager-rust",
"android.system.keystore2-V1-rust",
"libanyhow",
"libbinder_rs",
diff --git a/keystore2/aidl/Android.bp b/keystore2/aidl/Android.bp
index f30ad83..69ba0b4 100644
--- a/keystore2/aidl/Android.bp
+++ b/keystore2/aidl/Android.bp
@@ -116,8 +116,8 @@
}
aidl_interface {
- name: "android.security.usermanager",
- srcs: [ "android/security/usermanager/*.aidl" ],
+ name: "android.security.maintenance",
+ srcs: [ "android/security/maintenance/*.aidl" ],
imports: [
"android.system.keystore2",
],
diff --git a/keystore2/aidl/android/security/usermanager/IKeystoreUserManager.aidl b/keystore2/aidl/android/security/maintenance/IKeystoreMaintenance.aidl
similarity index 94%
rename from keystore2/aidl/android/security/usermanager/IKeystoreUserManager.aidl
rename to keystore2/aidl/android/security/maintenance/IKeystoreMaintenance.aidl
index 83edb1a..c789bb5 100644
--- a/keystore2/aidl/android/security/usermanager/IKeystoreUserManager.aidl
+++ b/keystore2/aidl/android/security/maintenance/IKeystoreMaintenance.aidl
@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package android.security.usermanager;
+package android.security.maintenance;
import android.system.keystore2.Domain;
// TODO: mark the interface with @SensitiveData when the annotation is ready (b/176110256).
/**
- * IKeystoreUserManager interface exposes the methods for adding/removing users and changing the
+ * IKeystoreMaintenance interface exposes the methods for adding/removing users and changing the
* user's password.
* @hide
*/
-interface IKeystoreUserManager {
+interface IKeystoreMaintenance {
/**
* Allows LockSettingsService to inform keystore about adding a new user.
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)
}