Replace keystore2_vintf's bindgen with cxx
This simplifies things by removing code and unsafe blocks.
Test: Boot
Test: keystore2_vintf_test
Change-Id: I5858a2a25e0ee27e42ee9846d44762da2454f706
diff --git a/keystore2/src/globals.rs b/keystore2/src/globals.rs
index a03a61c..eae5ad0 100644
--- a/keystore2/src/globals.rs
+++ b/keystore2/src/globals.rs
@@ -208,14 +208,14 @@
let service_name = match *security_level {
SecurityLevel::TRUSTED_ENVIRONMENT => {
- if keymint_instances.as_vec()?.iter().any(|instance| *instance == "default") {
+ if keymint_instances.iter().any(|instance| *instance == "default") {
Some(format!("{}/default", KEYMINT_SERVICE_NAME))
} else {
None
}
}
SecurityLevel::STRONGBOX => {
- if keymint_instances.as_vec()?.iter().any(|instance| *instance == "strongbox") {
+ if keymint_instances.iter().any(|instance| *instance == "strongbox") {
Some(format!("{}/strongbox", KEYMINT_SERVICE_NAME))
} else {
None
@@ -319,7 +319,7 @@
get_aidl_instances("android.hardware.security.secureclock", 1, "ISecureClock");
let secure_clock_available =
- secureclock_instances.as_vec()?.iter().any(|instance| *instance == "default");
+ secureclock_instances.iter().any(|instance| *instance == "default");
let default_time_stamp_service_name = format!("{}/default", TIME_STAMP_SERVICE_NAME);
@@ -372,14 +372,14 @@
let service_name = match *security_level {
SecurityLevel::TRUSTED_ENVIRONMENT => {
- if remotely_prov_instances.as_vec()?.iter().any(|instance| *instance == "default") {
+ if remotely_prov_instances.iter().any(|instance| *instance == "default") {
Some(format!("{}/default", REMOTE_PROVISIONING_HAL_SERVICE_NAME))
} else {
None
}
}
SecurityLevel::STRONGBOX => {
- if remotely_prov_instances.as_vec()?.iter().any(|instance| *instance == "strongbox") {
+ if remotely_prov_instances.iter().any(|instance| *instance == "strongbox") {
Some(format!("{}/strongbox", REMOTE_PROVISIONING_HAL_SERVICE_NAME))
} else {
None