Changing hwcrypto interface to stable am: 4e4c3ec3e7

Original change: https://android-review.googlesource.com/c/trusty/app/sample/+/3341069

Change-Id: I17a213fcf631cd47b61d11a6cc6a12be4aeba81b
Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/hwcryptohal/aidl/rust/rules.mk b/hwcryptohal/aidl/rust/rules.mk
index da13d41..a6f9ab7 100644
--- a/hwcryptohal/aidl/rust/rules.mk
+++ b/hwcryptohal/aidl/rust/rules.mk
@@ -17,9 +17,9 @@
 
 MODULE := $(LOCAL_DIR)
 
-HWCRYPTO_AIDL_DIR = hardware/interfaces/staging/security/see/hwcrypto/aidl
+HWCRYPTO_AIDL_DIR = hardware/interfaces/security/see/hwcrypto/aidl
 
-MODULE_CRATE_NAME := android_hardware_security_see
+MODULE_CRATE_NAME := android_hardware_security_see_hwcrypto
 
 MODULE_AIDL_LANGUAGE := rust
 
@@ -28,6 +28,11 @@
 MODULE_AIDL_INCLUDES := \
 	-I $(HWCRYPTO_AIDL_DIR) \
 
+MODULE_AIDL_FLAGS := \
+	--stability=vintf \
+
+MODULE_AIDL_FLAGS += --version=1
+
 MODULE_AIDLS := \
     $(HWCRYPTO_AIDL_DIR)/$(MODULE_AIDL_PACKAGE)/CryptoOperation.aidl                        \
     $(HWCRYPTO_AIDL_DIR)/$(MODULE_AIDL_PACKAGE)/CryptoOperationErrorAdditionalInfo.aidl     \
diff --git a/hwcryptohal/common/err.rs b/hwcryptohal/common/err.rs
index 1739c94..279490a 100644
--- a/hwcryptohal/common/err.rs
+++ b/hwcryptohal/common/err.rs
@@ -17,8 +17,8 @@
 //! HwCrypto error handling code and related structures
 
 use alloc::{collections::TryReserveError, ffi::CString};
-pub use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::HalErrorCode;
-use android_hardware_security_see::binder;
+pub use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::HalErrorCode;
+use android_hardware_security_see_hwcrypto::binder;
 use core::array::TryFromSliceError;
 use coset::CoseError;
 use std::sync::PoisonError;
diff --git a/hwcryptohal/common/policy.rs b/hwcryptohal/common/policy.rs
index b49e538..8692972 100644
--- a/hwcryptohal/common/policy.rs
+++ b/hwcryptohal/common/policy.rs
@@ -17,10 +17,10 @@
 //! KeyPolicy serialization facilities
 
 use alloc::collections::btree_set::BTreeSet;
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
     KeyLifetime::KeyLifetime, KeyPermissions::KeyPermissions, KeyType::KeyType, KeyUse::KeyUse,
 };
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::KeyPolicy::KeyPolicy;
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::KeyPolicy::KeyPolicy;
 use ciborium::Value;
 use coset::{AsCborValue, CborSerializable, CoseError};
 
diff --git a/hwcryptohal/server/cmd_processing.rs b/hwcryptohal/server/cmd_processing.rs
index 27191f1..93c73e1 100644
--- a/hwcryptohal/server/cmd_processing.rs
+++ b/hwcryptohal/server/cmd_processing.rs
@@ -16,10 +16,10 @@
 
 //! Module providing an implementation of a cryptographic command processor.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
     MemoryBufferReference::MemoryBufferReference, OperationData::OperationData,
 };
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     CryptoOperation::CryptoOperation,
     MemoryBufferParameter::{
         MemoryBuffer::MemoryBuffer as MemoryBufferAidl, MemoryBufferParameter,
@@ -814,7 +814,7 @@
 mod tests {
     use super::*;
     use crate::opaque_key::OpaqueKey;
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         types::{
             AesCipherMode::AesCipherMode, CipherModeParameters::CipherModeParameters, HalErrorCode,
             KeyLifetime::KeyLifetime, KeyType::KeyType, KeyUse::KeyUse,
diff --git a/hwcryptohal/server/crypto_operation.rs b/hwcryptohal/server/crypto_operation.rs
index 1db73e1..8e2a61d 100644
--- a/hwcryptohal/server/crypto_operation.rs
+++ b/hwcryptohal/server/crypto_operation.rs
@@ -16,11 +16,11 @@
 
 //! Module providing a shim for the different crypto operations.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
     HmacOperationParameters::HmacOperationParameters, KeyUse::KeyUse,
     SymmetricCryptoParameters::SymmetricCryptoParameters, SymmetricOperation::SymmetricOperation,
 };
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     OperationParameters::OperationParameters, PatternParameters::PatternParameters,
 };
 use hwcryptohal_common::{err::HwCryptoError, hwcrypto_err};
@@ -670,7 +670,7 @@
 #[cfg(test)]
 mod tests {
     use super::*;
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
         AesCipherMode::AesCipherMode, CipherModeParameters::CipherModeParameters,
         KeyLifetime::KeyLifetime,
         KeyType::KeyType, KeyUse::KeyUse,
@@ -678,7 +678,7 @@
         SymmetricOperation::SymmetricOperation,
         SymmetricOperationParameters::SymmetricOperationParameters,
     };
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         KeyPolicy::KeyPolicy,
     };
     use test::{expect, expect_eq};
diff --git a/hwcryptohal/server/crypto_operation_context.rs b/hwcryptohal/server/crypto_operation_context.rs
index 02765c2..b7c89e6 100644
--- a/hwcryptohal/server/crypto_operation_context.rs
+++ b/hwcryptohal/server/crypto_operation_context.rs
@@ -17,7 +17,7 @@
 //! Implementation of the `ICryptoOperationContext` AIDL interface. It can be used to execute more
 //! commands over the same context.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     CryptoOperation::CryptoOperation, ICryptoOperationContext::BnCryptoOperationContext,
     ICryptoOperationContext::ICryptoOperationContext,
 };
diff --git a/hwcryptohal/server/helpers.rs b/hwcryptohal/server/helpers.rs
index ec6d039..b779e4a 100644
--- a/hwcryptohal/server/helpers.rs
+++ b/hwcryptohal/server/helpers.rs
@@ -16,7 +16,7 @@
 
 //! Helper functions that includes data transformation for AIDL types.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
     AesCipherMode::AesCipherMode, AesKey::AesKey, CipherModeParameters::CipherModeParameters,
     ExplicitKeyMaterial::ExplicitKeyMaterial, HmacKey::HmacKey, KeyType::KeyType, KeyUse::KeyUse,
     SymmetricCryptoParameters::SymmetricCryptoParameters, SymmetricOperation::SymmetricOperation,
diff --git a/hwcryptohal/server/hwcrypto_device_key.rs b/hwcryptohal/server/hwcrypto_device_key.rs
index b3bf63e..1241880 100644
--- a/hwcryptohal/server/hwcrypto_device_key.rs
+++ b/hwcryptohal/server/hwcrypto_device_key.rs
@@ -17,7 +17,7 @@
 //! Implementation of the `IHwCryptoKey` AIDL interface. It can be use to generate and
 //! retrieve device specific keys.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     types::{
         ExplicitKeyMaterial::ExplicitKeyMaterial, KeyLifetime::KeyLifetime, KeyType::KeyType,
         KeyUse::KeyUse, OpaqueKeyToken::OpaqueKeyToken,
@@ -32,7 +32,7 @@
     IOpaqueKey::IOpaqueKey,
     KeyPolicy::KeyPolicy,
 };
-use android_hardware_security_see::binder;
+use android_hardware_security_see_hwcrypto::binder;
 use ciborium::{cbor, Value};
 use coset::{AsCborValue, CborSerializable, CoseError};
 use hwcryptohal_common::{cose_enum_gen, err::HwCryptoError, hwcrypto_err};
@@ -434,7 +434,7 @@
 mod tests {
     use super::*;
     use crate::hwcrypto_ipc_server::RUST_SERVICE_PORT;
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         types::{
             AesCipherMode::AesCipherMode, AesKey::AesKey,
             CipherModeParameters::CipherModeParameters, HmacKey::HmacKey,
diff --git a/hwcryptohal/server/hwcrypto_ipc_server.rs b/hwcryptohal/server/hwcrypto_ipc_server.rs
index a69b2c3..a4f0a2f 100644
--- a/hwcryptohal/server/hwcrypto_ipc_server.rs
+++ b/hwcryptohal/server/hwcrypto_ipc_server.rs
@@ -95,8 +95,8 @@
 
 #[cfg(test)]
 mod tests {
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::IHwCryptoKey::IHwCryptoKey;
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::IHwCryptoOperations::IHwCryptoOperations;
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::IHwCryptoKey::IHwCryptoKey;
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::IHwCryptoOperations::IHwCryptoOperations;
     use rpcbinder::RpcSession;
     use binder::{IBinder, Strong};
     use test::expect_eq;
diff --git a/hwcryptohal/server/hwcrypto_operations.rs b/hwcryptohal/server/hwcrypto_operations.rs
index 3ffa046..6b9769d 100644
--- a/hwcryptohal/server/hwcrypto_operations.rs
+++ b/hwcryptohal/server/hwcrypto_operations.rs
@@ -17,12 +17,12 @@
 //! Implementation of the `IHwCryptoOperations` AIDL interface. It can be use to retrieve the
 //! key generation interface and to process cryptographic operations.
 
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     CryptoOperationErrorAdditionalInfo::CryptoOperationErrorAdditionalInfo,
     CryptoOperationResult::CryptoOperationResult, CryptoOperationSet::CryptoOperationSet,
     IHwCryptoOperations::BnHwCryptoOperations, IHwCryptoOperations::IHwCryptoOperations,
 };
-use android_hardware_security_see::binder;
+use android_hardware_security_see_hwcrypto::binder;
 use hwcryptohal_common::hwcrypto_err;
 
 use crate::cmd_processing::CmdProcessorContext;
@@ -78,7 +78,7 @@
 mod tests {
     use super::*;
     use crate::hwcrypto_ipc_server::RUST_SERVICE_PORT;
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         types::{
             AesCipherMode::AesCipherMode, CipherModeParameters::CipherModeParameters,
             HmacOperationParameters::HmacOperationParameters, KeyLifetime::KeyLifetime,
diff --git a/hwcryptohal/server/opaque_key.rs b/hwcryptohal/server/opaque_key.rs
index 9a571af..8bb8564 100644
--- a/hwcryptohal/server/opaque_key.rs
+++ b/hwcryptohal/server/opaque_key.rs
@@ -17,13 +17,13 @@
 //! Implementation of the `IOpaqueKey` AIDL interface. It is used as a handle to key material
 
 use alloc::collections::btree_map::BTreeMap;
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::types::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::types::{
     AesCipherMode::AesCipherMode, KeyLifetime::KeyLifetime, KeyPermissions::KeyPermissions,
     KeyType::KeyType, KeyUse::KeyUse, OpaqueKeyToken::OpaqueKeyToken, OperationType::OperationType,
     ProtectionId::ProtectionId, SymmetricCryptoParameters::SymmetricCryptoParameters,
     SymmetricOperation::SymmetricOperation,
 };
-use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
     IHwCryptoKey::{
         DeviceKeyId::DeviceKeyId, DiceBoundDerivationKey::DiceBoundDerivationKey,
         DiceBoundKeyResult::DiceBoundKeyResult,
@@ -31,7 +31,7 @@
     IOpaqueKey::{BnOpaqueKey, IOpaqueKey},
     KeyPolicy::KeyPolicy,
 };
-use android_hardware_security_see::binder;
+use android_hardware_security_see_hwcrypto::binder;
 use binder::binder_impl::Binder;
 use ciborium::Value;
 use core::fmt;
diff --git a/hwcryptokey-test/aes_vectors.rs b/hwcryptokey-test/aes_vectors.rs
index 4bca737..4c5c5a9 100644
--- a/hwcryptokey-test/aes_vectors.rs
+++ b/hwcryptokey-test/aes_vectors.rs
@@ -17,7 +17,7 @@
 mod tests {
     pub(crate) const RUST_HWCRYPTO_SERVICE_PORT: &str = "com.android.trusty.rust.hwcryptohal.V1";
 
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         types::{
             AesCipherMode::AesCipherMode, AesKey::AesKey,
             CipherModeParameters::CipherModeParameters, ExplicitKeyMaterial::ExplicitKeyMaterial,
diff --git a/hwcryptokey-test/versioned_keys_explicit.rs b/hwcryptokey-test/versioned_keys_explicit.rs
index 0b1becc..5690ffb 100644
--- a/hwcryptokey-test/versioned_keys_explicit.rs
+++ b/hwcryptokey-test/versioned_keys_explicit.rs
@@ -15,7 +15,7 @@
  */
 #[cfg(test)]
 mod tests {
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         IHwCryptoKey::{
             DerivedKey::DerivedKey, DerivedKeyParameters::DerivedKeyParameters,
             DerivedKeyPolicy::DerivedKeyPolicy, DeviceKeyId::DeviceKeyId,
diff --git a/hwcryptokey-test/versioned_keys_opaque.rs b/hwcryptokey-test/versioned_keys_opaque.rs
index 2394a54..9a40d5b 100644
--- a/hwcryptokey-test/versioned_keys_opaque.rs
+++ b/hwcryptokey-test/versioned_keys_opaque.rs
@@ -16,7 +16,7 @@
 
 #[cfg(test)]
 mod tests {
-    use android_hardware_security_see::aidl::android::hardware::security::see::hwcrypto::{
+    use android_hardware_security_see_hwcrypto::aidl::android::hardware::security::see::hwcrypto::{
         types::{
             AesCipherMode::AesCipherMode, CipherModeParameters::CipherModeParameters,
             KeyLifetime::KeyLifetime, KeyType::KeyType, KeyUse::KeyUse,