Revert^2 "[keystore2] Fix binder import path"
Import from the binder crate root instead of binder::public_api for
compatibility with the new crate structure.
Original change: Ia9695e5493bda965ca9a42989ec5a284407595ce
Test: m
Bug: 196056781
Change-Id: Ie6303a36a956cf73f317520a0e0a00ec4adbb47e
diff --git a/keystore2/src/security_level.rs b/keystore2/src/security_level.rs
index 31bf294..9334930 100644
--- a/keystore2/src/security_level.rs
+++ b/keystore2/src/security_level.rs
@@ -368,7 +368,7 @@
}
};
- let op_binder: binder::public_api::Strong<dyn IKeystoreOperation> =
+ let op_binder: binder::Strong<dyn IKeystoreOperation> =
KeystoreOperation::new_native_binder(operation)
.as_binder()
.into_interface()
@@ -985,7 +985,7 @@
key: &KeyDescriptor,
operation_parameters: &[KeyParameter],
forced: bool,
- ) -> binder::public_api::Result<CreateOperationResponse> {
+ ) -> binder::Result<CreateOperationResponse> {
let _wp = self.watch_millis("IKeystoreSecurityLevel::createOperation", 500);
map_or_log_err(self.create_operation(key, operation_parameters, forced), Ok)
}
@@ -996,7 +996,7 @@
params: &[KeyParameter],
flags: i32,
entropy: &[u8],
- ) -> binder::public_api::Result<KeyMetadata> {
+ ) -> binder::Result<KeyMetadata> {
// Duration is set to 5 seconds, because generateKey - especially for RSA keys, takes more
// time than other operations
let _wp = self.watch_millis("IKeystoreSecurityLevel::generateKey", 5000);
@@ -1012,7 +1012,7 @@
params: &[KeyParameter],
flags: i32,
key_data: &[u8],
- ) -> binder::public_api::Result<KeyMetadata> {
+ ) -> binder::Result<KeyMetadata> {
let _wp = self.watch_millis("IKeystoreSecurityLevel::importKey", 500);
let result = self.import_key(key, attestation_key, params, flags, key_data);
log_key_creation_event_stats(self.security_level, params, &result);
@@ -1026,7 +1026,7 @@
masking_key: Option<&[u8]>,
params: &[KeyParameter],
authenticators: &[AuthenticatorSpec],
- ) -> binder::public_api::Result<KeyMetadata> {
+ ) -> binder::Result<KeyMetadata> {
let _wp = self.watch_millis("IKeystoreSecurityLevel::importWrappedKey", 500);
let result =
self.import_wrapped_key(key, wrapping_key, masking_key, params, authenticators);
@@ -1037,11 +1037,11 @@
fn convertStorageKeyToEphemeral(
&self,
storage_key: &KeyDescriptor,
- ) -> binder::public_api::Result<EphemeralStorageKeyResponse> {
+ ) -> binder::Result<EphemeralStorageKeyResponse> {
let _wp = self.watch_millis("IKeystoreSecurityLevel::convertStorageKeyToEphemeral", 500);
map_or_log_err(self.convert_storage_key_to_ephemeral(storage_key), Ok)
}
- fn deleteKey(&self, key: &KeyDescriptor) -> binder::public_api::Result<()> {
+ fn deleteKey(&self, key: &KeyDescriptor) -> binder::Result<()> {
let _wp = self.watch_millis("IKeystoreSecurityLevel::deleteKey", 500);
let result = self.delete_key(key);
log_key_deleted(key, ThreadState::get_calling_uid(), result.is_ok());