Register RKP HAL only when it is declared in VINTF
No need to register the hal unless it is declared in VINTF.
Test: Disable remote attestation and run an app with VM
to check there's no error for the registration.
Bug: 343576424
Change-Id: Ia5df43b2a15156976b68a09695e4e89dd8bc0710
diff --git a/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs
index 5e71245..8fe4167 100644
--- a/virtualizationservice/src/aidl.rs
+++ b/virtualizationservice/src/aidl.rs
@@ -346,7 +346,7 @@
))
.with_log();
}
- if !remotely_provisioned_component_service_exists()? {
+ if !is_remote_provisioning_hal_declared()? {
return Err(Status::new_exception_str(
ExceptionCode::UNSUPPORTED_OPERATION,
Some("AVF remotely provisioned component service is not declared"),
@@ -403,7 +403,7 @@
}
fn isRemoteAttestationSupported(&self) -> binder::Result<bool> {
- remotely_provisioned_component_service_exists()
+ is_remote_provisioning_hal_declared()
}
fn getAssignableDevices(&self) -> binder::Result<Vec<AssignableDevice>> {
@@ -862,7 +862,9 @@
Ok(())
}
-fn remotely_provisioned_component_service_exists() -> binder::Result<bool> {
+/// Returns true if the AVF remotely provisioned component service is declared in the
+/// VINTF manifest.
+pub(crate) fn is_remote_provisioning_hal_declared() -> binder::Result<bool> {
Ok(binder::is_declared(REMOTELY_PROVISIONED_COMPONENT_SERVICE_NAME)?)
}