Remove reference to unimplemented HALs
These aren't used in the VM so clean up the references to them.
Bug: 190578423
Test: atest MicrodroidHostTestCases
Change-Id: I5cb91b83017f1b17f1d2ba962db27dd9d398f50b
diff --git a/microdroid/keymint/service.cpp b/microdroid/keymint/service.cpp
index 8467b33..2cdad0f 100644
--- a/microdroid/keymint/service.cpp
+++ b/microdroid/keymint/service.cpp
@@ -27,35 +27,19 @@
using aidl::android::hardware::security::keymint::MicrodroidKeyMintDevice;
using aidl::android::hardware::security::keymint::SecurityLevel;
-template <typename T, class... Args>
-std::shared_ptr<T> addService(Args&&... args) {
- std::shared_ptr<T> ser = ndk::SharedRefBase::make<T>(std::forward<Args>(args)...);
- auto instanceName = std::string(T::descriptor) + "/default";
- LOG(INFO) << "adding keymint service instance: " << instanceName;
- binder_status_t status =
- AServiceManager_addService(ser->asBinder().get(), instanceName.c_str());
- CHECK(status == STATUS_OK);
- return ser;
-}
-
int main() {
- // Zero threads seems like a useless pool, but below we'll join this thread to it, increasing
- // the pool size to 1.
+ // Zero threads seems like a useless pool, but below we'll join this thread
+ // to it, increasing the pool size to 1.
ABinderProcess_setThreadPoolMaxThreadCount(0);
+
// Add Keymint Service
std::shared_ptr<MicrodroidKeyMintDevice> keyMint =
- addService<MicrodroidKeyMintDevice>(SecurityLevel::SOFTWARE);
-
- // VMs cannot implement the Secure Clock Service
- // addService<AndroidSecureClock>(keyMint);
-
- // VMs don't need to implement the Shared Secret Service as the host
- // facilities the establishment of the shared secret.
- // addService<AndroidSharedSecret>(keyMint);
-
- // VMs don't implement the Remotely Provisioned Component Service as the
- // host facilities provisioning.
- // addService<AndroidRemotelyProvisionedComponentDevice>(keyMint);
+ ndk::SharedRefBase::make<MicrodroidKeyMintDevice>(SecurityLevel::SOFTWARE);
+ auto instanceName = std::string(MicrodroidKeyMintDevice::descriptor) + "/default";
+ LOG(INFO) << "adding keymint service instance: " << instanceName;
+ binder_status_t status =
+ AServiceManager_addService(keyMint->asBinder().get(), instanceName.c_str());
+ CHECK(status == STATUS_OK);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/microdroid/sepolicy/system/public/hal_keymint.te b/microdroid/sepolicy/system/public/hal_keymint.te
index e56ab99..7570188 100644
--- a/microdroid/sepolicy/system/public/hal_keymint.te
+++ b/microdroid/sepolicy/system/public/hal_keymint.te
@@ -1,5 +1,4 @@
binder_call(hal_keymint_client, hal_keymint_server)
hal_attribute_service(hal_keymint, hal_keymint_service)
-hal_attribute_service(hal_keymint, hal_remotelyprovisionedcomponent_service)
binder_call(hal_keymint_server, servicemanager)
diff --git a/microdroid/sepolicy/vendor/hal_keymint_default.te b/microdroid/sepolicy/vendor/hal_keymint_default.te
index 3b86a1b..d86b7b4 100644
--- a/microdroid/sepolicy/vendor/hal_keymint_default.te
+++ b/microdroid/sepolicy/vendor/hal_keymint_default.te
@@ -4,7 +4,4 @@
type hal_keymint_default_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_keymint_default)
-hal_attribute_service(hal_keymint, hal_secureclock_service)
-hal_attribute_service(hal_keymint, hal_sharedsecret_service)
-
get_prop(hal_keymint_default, vendor_security_patch_level_prop);