Change error.rs to use generated types.

This patch also removes AidlResult form the error module.
The new version of the Keystore 2.0 AIDL spec requires that ResponseCode
and ErrorCode will be returned as service specific error, instead of the
Result type.

Test: keystore2_test
Change-Id: I6f730b282c84abc8be2e693e5d2c7053648d7588
diff --git a/keystore2/src/key_parameter.rs b/keystore2/src/key_parameter.rs
index 1eb5d41..5266c28 100644
--- a/keystore2/src/key_parameter.rs
+++ b/keystore2/src/key_parameter.rs
@@ -17,7 +17,7 @@
 //! and the methods to work with KeyParameter.
 
 use crate::error::Error as KeystoreError;
-use crate::error::ResponseCode;
+use crate::error::Rc;
 pub use android_hardware_keymint::aidl::android::hardware::keymint::{
     Algorithm, Algorithm::Algorithm as AlgorithmType, BlockMode,
     BlockMode::BlockMode as BlockModeType, Digest, Digest::Digest as DigestType, EcCurve,
@@ -354,14 +354,14 @@
             Tag::PURPOSE => {
                 let key_purpose: KeyPurposeType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: PURPOSE.")?;
                 KeyParameterValue::KeyPurpose(key_purpose)
             }
             Tag::ALGORITHM => {
                 let algorithm: AlgorithmType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: ALGORITHM.")?;
                 KeyParameterValue::Algorithm(algorithm)
             }
@@ -373,21 +373,21 @@
             Tag::BLOCK_MODE => {
                 let block_mode: BlockModeType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: BLOCK_MODE.")?;
                 KeyParameterValue::BlockMode(block_mode)
             }
             Tag::DIGEST => {
                 let digest: DigestType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: DIGEST.")?;
                 KeyParameterValue::Digest(digest)
             }
             Tag::PADDING => {
                 let padding: PaddingModeType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: PADDING.")?;
                 KeyParameterValue::PaddingMode(padding)
             }
@@ -400,7 +400,7 @@
             Tag::EC_CURVE => {
                 let ec_curve: EcCurveType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: EC_CURVE.")?;
                 KeyParameterValue::EcCurve(ec_curve)
             }
@@ -455,7 +455,7 @@
             Tag::USER_AUTH_TYPE => {
                 let user_auth_type: HardwareAuthenticatorTypeType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: USER_AUTH_TYPE.")?;
                 KeyParameterValue::HardwareAuthenticatorType(user_auth_type)
             }
@@ -486,7 +486,7 @@
             Tag::ORIGIN => {
                 let origin: KeyOriginType = data
                     .get()
-                    .map_err(|_| KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                    .map_err(|_| KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to read sql data for tag: ORIGIN.")?;
                 KeyParameterValue::KeyOrigin(origin)
             }
@@ -598,7 +598,7 @@
                 KeyParameterValue::ConfirmationToken(confirmation_token)
             }
             _ => {
-                return Err(KeystoreError::Rc(ResponseCode::ValueCorrupted))
+                return Err(KeystoreError::Rc(Rc::ValueCorrupted))
                     .context("Failed to decode Tag enum from value.")?
             }
         };